-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (95 loc) · 3.27 KB
/
pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
on:
push:
branches:
- '*'
- '!release'
tags:
- 'v*'
name: Pipeline
jobs:
test-linux:
name: "Linux Test"
runs-on: ubuntu-latest
strategy:
matrix:
suite: [lint, centos]
steps:
- uses: actions/checkout@v2.0.0
- name: Checkout submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: manage ci
run: |
./manage trust-escapace
./manage ci
env:
TEST_SUITE: ${{ matrix.suite }}
test-macOS:
name: "macOS Test"
runs-on: macos-latest
steps:
- uses: actions/checkout@v2.0.0
- name: Checkout submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: manage ci
run: |
brew install bash gnu-sed gnupg
./manage trust-escapace
./manage ci
env:
TEST_SUITE: osx
docker:
name: "Docker build and push"
runs-on: ubuntu-latest
needs: [test-macOS, test-linux]
steps:
- uses: actions/checkout@v2.0.0
if: contains(github.ref, 'tags/v')
- name: Checkout submodules
if: contains(github.ref, 'tags/v')
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Docker Build & Push
if: contains(github.ref, 'tags/v')
shell: bash
run: |
echo ${DOCKER_ACCESS_TOKEN} | docker login -u ${DOCKER_USERNAME} --password-stdin
docker build -t escapace/manage:latest -t escapace/manage:${GITHUB_REF:11} .
docker push escapace/manage:latest
docker push escapace/manage:${GITHUB_REF:11}
env:
DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
release:
name: "Github Release"
runs-on: ubuntu-latest
needs: [test-macOS, test-linux]
steps:
- uses: actions/checkout@v2.0.0
if: contains(github.ref, 'tags/v')
- name: Checkout submodules
if: contains(github.ref, 'tags/v')
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: release
if: contains(github.ref, 'tags/v')
run: |
mkdir ~/bin
wget -qO- https://github.com/github/hub/releases/download/v2.12.3/hub-linux-amd64-2.12.3.tgz | tar xvz -C ~/bin --strip=2 --wildcards --no-anchored 'hub*/bin/hub'
~/bin/hub release create -a manage -m "manage ${GITHUB_REF:11}" -t release v${GITHUB_REF:11}
env:
GITHUB_USER: escapace
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}