-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (83 loc) · 2.52 KB
/
CD.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
name: CD
on:
push:
tags: 'v*'
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Cache node modules
uses: actions/[email protected]
with:
path: node_modules
key: node-${{ hashFiles('package-lock.json') }}
- name: Generate package
id: package
run: |
version="${GITHUB_REF##*/*/v}"
echo ::set-output name=version::$version
npm install
npm run build -- $version python${{ matrix.python }}-linux
env:
TOKEN: ${{ secrets.TOKEN }}
- name: Upload
uses: softprops/action-gh-release@v1
with:
files: "GeodePackage-${{ steps.package.outputs.version }}-python${{ matrix.python }}-linux.zip"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Notify slack
if: failure() && github.ref == 'refs/heads/master'
uses: 8398a7/action-slack@v2
with:
status: failure
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
build-windows:
runs-on: windows-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Cache node modules
uses: actions/[email protected]
with:
path: node_modules
key: node-${{ hashFiles('package-lock.json') }}
- name: Generate package
id: package
run: |
$version = ${env:GITHUB_REF} -replace 'refs\/tags\/v', ''
echo "::set-output name=version::$version"
npm install
npm run build -- $version python${{ matrix.python }}-win64
env:
TOKEN: ${{ secrets.TOKEN }}
- name: Upload
uses: softprops/action-gh-release@v1
with:
files: "GeodePackage-${{ steps.package.outputs.version }}-python${{ matrix.python }}-win64.zip"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Notify slack
if: failure() && github.ref == 'refs/heads/master'
uses: 8398a7/action-slack@v2
with:
status: failure
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}