-
Notifications
You must be signed in to change notification settings - Fork 11
88 lines (75 loc) · 1.93 KB
/
release.yml
File metadata and controls
88 lines (75 loc) · 1.93 KB
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
name: Build and Release
on:
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
arch:
- x64
- arm64
node-version:
- node18
os:
- linux
- macos
- win
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install node 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- name: Run build
run: |
npm install
npm run build
- name: Package Node.js binary with pkg
id: pkg-action
uses: ./.github/actions/pkg-action
with:
entrypoint: .
arch: ${{ matrix.arch }}
node-version: ${{ matrix.node-version }}
os: ${{ matrix.os }}
release:
needs: build
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download binaries
id: download
uses: actions/download-artifact@v3
with:
path: binaries
- name: deubg ls binaries
shell: bash
run: |
ls -la ${{steps.download.outputs.download-path}}/*
- name: Prepare files for release
run: |
mkdir release_assets
cd binaries
for dir in */; do
file_name=$(basename "${dir}" | cut -d'-' -f1-5)
zip -j "../release_assets/${file_name}.zip" "${dir}"*
done
cd ..
- name: Extract tag name
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
fail_on_unmatched_files: true
files: |
release_assets/*.zip
name: Release ${{ steps.get_version.outputs.VERSION }}
tag_name: ${{ github.ref }}