-
Notifications
You must be signed in to change notification settings - Fork 20
99 lines (94 loc) · 3.01 KB
/
release.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
96
97
98
99
name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Dump upload url to file
run: echo '${{ steps.create_release.outputs.upload_url }}' > upload_url
- name: Upload upload_url
uses: actions/upload-artifact@v1
with:
name: upload_url
path: upload_url
build:
needs: create-release
strategy:
matrix:
platform: [
'linux-arm',
'linux-arm64',
'linux-x64',
]
pair: [
'node:10',
'node:12',
'node:14',
]
include:
- platform: 'linux-arm'
host-os: 'ubuntu-latest'
- platform: 'linux-arm64'
host-os: 'ubuntu-latest'
- platform: 'linux-x64'
host-os: 'ubuntu-latest'
- pair: 'node:10'
language: 'node'
version: '10'
- pair: 'node:12'
language: 'node'
version: '12'
- pair: 'node:14'
language: 'node'
version: '14'
runs-on: ${{ matrix.host-os }}
steps:
- name: Download upload_url
uses: actions/download-artifact@v1
with:
name: upload_url
- name: Set upload_url
run: echo "UPLOAD_URL=$(cat upload_url/upload_url)" >> $GITHUB_ENV
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
- name: Build adapter
run: |
./build.sh "${{ matrix.platform }}" "${{ matrix.language }}" "${{ matrix.version }}"
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: zwave-adapter-${{ env.RELEASE_VERSION }}-${{ matrix.platform }}-v${{ matrix.version }}.tgz
asset_name: zwave-adapter-${{ env.RELEASE_VERSION }}-${{ matrix.platform }}-v${{ matrix.version }}.tgz
asset_content_type: application/zip
- name: Upload Release Asset Checksum
id: upload-release-asset-checksum
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: zwave-adapter-${{ env.RELEASE_VERSION }}-${{ matrix.platform }}-v${{ matrix.version }}.tgz.sha256sum
asset_name: zwave-adapter-${{ env.RELEASE_VERSION }}-${{ matrix.platform }}-v${{ matrix.version }}.tgz.sha256sum
asset_content_type: text/plain