Skip to content

Commit dd5428c

Browse files
committed
fix(Actions): one job per platform
1 parent 5865f2d commit dd5428c

File tree

2 files changed

+162
-16
lines changed

2 files changed

+162
-16
lines changed

.github/workflows/CD.yml

Lines changed: 90 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,100 @@ on:
55
tags: 'v*'
66

77
jobs:
8-
build:
8+
build-linux:
99
runs-on: ubuntu-18.04
1010
strategy:
1111
matrix:
12-
system: [ubuntu, darwin, win64]
1312
python: [3.6, 3.7, 3.8]
14-
exclude:
15-
- system: win64
16-
python: 3.8
1713

1814
steps:
1915
- uses: actions/checkout@v1
16+
- name: Set up Python ${{ matrix.python }}
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: ${{ matrix.python }}
20+
- name: Cache node modules
21+
uses: actions/[email protected]
22+
with:
23+
path: node_modules
24+
key: node-${{ hashFiles('package-lock.json') }}
25+
- name: Generate package
26+
id: package
27+
run: |
28+
version="${GITHUB_REF##*/*/v}"
29+
echo ::set-output name=version::$version
30+
npm install
31+
npm run build -- $version python${{ matrix.python }}-ubuntu
32+
env:
33+
TOKEN: ${{ secrets.TOKEN }}
34+
- name: Upload
35+
uses: softprops/action-gh-release@v1
36+
with:
37+
files: "GeodePackage-${{ steps.package.outputs.version }}-python${{ matrix.python }}-ubuntu.zip"
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
- name: Notify slack
41+
if: failure() && github.ref == 'refs/heads/master'
42+
uses: 8398a7/action-slack@v2
43+
with:
44+
status: failure
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
48+
49+
build-mac:
50+
runs-on: macos-latest
51+
strategy:
52+
matrix:
53+
python: [3.6, 3.7, 3.8]
54+
55+
steps:
56+
- uses: actions/checkout@v1
57+
- name: Set up Python ${{ matrix.python }}
58+
uses: actions/setup-python@v2
59+
with:
60+
python-version: ${{ matrix.python }}
61+
- name: Cache node modules
62+
uses: actions/[email protected]
63+
with:
64+
path: node_modules
65+
key: node-${{ hashFiles('package-lock.json') }}
66+
- name: Generate package
67+
id: package
68+
run: |
69+
version="${GITHUB_REF##*/*/v}"
70+
echo ::set-output name=version::$version
71+
npm install
72+
npm run build -- $version python${{ matrix.python }}-darwin
73+
env:
74+
TOKEN: ${{ secrets.TOKEN }}
75+
- name: Upload
76+
uses: softprops/action-gh-release@v1
77+
with:
78+
files: "GeodePackage-${{ steps.package.outputs.version }}-python${{ matrix.python }}-darwin.zip"
79+
env:
80+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
- name: Notify slack
82+
if: failure() && github.ref == 'refs/heads/master'
83+
uses: 8398a7/action-slack@v2
84+
with:
85+
status: failure
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
89+
90+
build-windows:
91+
runs-on: windows-2016
92+
strategy:
93+
matrix:
94+
python: [3.6, 3.7]
95+
96+
steps:
97+
- uses: actions/checkout@v1
98+
- name: Set up Python ${{ matrix.python }}
99+
uses: actions/setup-python@v2
100+
with:
101+
python-version: ${{ matrix.python }}
20102
- name: Cache node modules
21103
uses: actions/[email protected]
22104
with:
@@ -28,13 +110,13 @@ jobs:
28110
version="${GITHUB_REF##*/*/v}"
29111
echo ::set-output name=version::$version
30112
npm install
31-
npm run build -- $version python${{ matrix.python }}-${{ matrix.system }}
113+
npm run build -- $version python${{ matrix.python }}-win64
32114
env:
33115
TOKEN: ${{ secrets.TOKEN }}
34116
- name: Upload
35117
uses: softprops/action-gh-release@v1
36118
with:
37-
files: "GeodePackage-${{ steps.package.outputs.version }}-python${{ matrix.python }}-${{ matrix.system }}.zip"
119+
files: "GeodePackage-${{ steps.package.outputs.version }}-python${{ matrix.python }}-win64.zip"
38120
env:
39121
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40122
- name: Notify slack
@@ -44,4 +126,4 @@ jobs:
44126
status: failure
45127
env:
46128
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
129+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/CI.yml

Lines changed: 72 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,82 @@ on:
55
pull_request:
66

77
jobs:
8-
build:
8+
build-linux:
99
runs-on: ubuntu-18.04
1010
strategy:
1111
matrix:
12-
system: [ubuntu, darwin, win64]
1312
python: [3.6, 3.7, 3.8]
14-
exclude:
15-
- system: win64
16-
python: 3.8
1713

1814
steps:
1915
- uses: actions/checkout@v1
16+
- name: Set up Python ${{ matrix.python }}
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: ${{ matrix.python }}
20+
- name: Cache node modules
21+
uses: actions/[email protected]
22+
with:
23+
path: node_modules
24+
key: node-${{ hashFiles('package-lock.json') }}
25+
- name: Compile
26+
run: |
27+
npm install
28+
npm run build -- version python${{ matrix.python }}-ubuntu
29+
env:
30+
TOKEN: ${{ secrets.TOKEN }}
31+
- name: Notify slack
32+
if: failure() && github.ref == 'refs/heads/master'
33+
uses: 8398a7/action-slack@v2
34+
with:
35+
status: failure
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
39+
40+
build-mac:
41+
runs-on: macos-latest
42+
strategy:
43+
matrix:
44+
python: [3.6, 3.7, 3.8]
45+
46+
steps:
47+
- uses: actions/checkout@v1
48+
- name: Set up Python ${{ matrix.python }}
49+
uses: actions/setup-python@v2
50+
with:
51+
python-version: ${{ matrix.python }}
52+
- name: Cache node modules
53+
uses: actions/[email protected]
54+
with:
55+
path: node_modules
56+
key: node-${{ hashFiles('package-lock.json') }}
57+
- name: Compile
58+
run: |
59+
npm install
60+
npm run build -- version python${{ matrix.python }}-darwin
61+
env:
62+
TOKEN: ${{ secrets.TOKEN }}
63+
- name: Notify slack
64+
if: failure() && github.ref == 'refs/heads/master'
65+
uses: 8398a7/action-slack@v2
66+
with:
67+
status: failure
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
71+
72+
build-windows:
73+
runs-on: windows-2016
74+
strategy:
75+
matrix:
76+
python: [3.6, 3.7]
77+
78+
steps:
79+
- uses: actions/checkout@v1
80+
- name: Set up Python ${{ matrix.python }}
81+
uses: actions/setup-python@v2
82+
with:
83+
python-version: ${{ matrix.python }}
2084
- name: Cache node modules
2185
uses: actions/[email protected]
2286
with:
@@ -25,7 +89,7 @@ jobs:
2589
- name: Compile
2690
run: |
2791
npm install
28-
npm run build -- version python${{ matrix.python }}-${{ matrix.system }}
92+
npm run build -- version python${{ matrix.python }}-win64
2993
env:
3094
TOKEN: ${{ secrets.TOKEN }}
3195
- name: Notify slack
@@ -35,11 +99,11 @@ jobs:
3599
status: failure
36100
env:
37101
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
102+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
39103

40104
semantic-release:
41105
runs-on: ubuntu-18.04
42-
needs: build
106+
needs: [build-linux, build-mac, build-windows]
43107
steps:
44108
- uses: actions/checkout@v1
45109
- run: npx semantic-release

0 commit comments

Comments
 (0)