Skip to content

Commit b6a6c1b

Browse files
committed
Update release script and add workflow
1 parent b06e99b commit b6a6c1b

File tree

2 files changed

+62
-13
lines changed

2 files changed

+62
-13
lines changed

.github/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Release (Nightly)
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release-nightly:
10+
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
platform: [linux, macos, windows]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@master
20+
21+
- name: Setup Node.js Environment
22+
uses: actions/setup-node@v1
23+
with:
24+
node-version: 12.x
25+
26+
- name: Build artifacts
27+
run: |
28+
npm install
29+
npm run build
30+
npm run pkg
31+
32+
- name: Create Release
33+
id: create_release
34+
uses: actions/[email protected]
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
with:
38+
tag_name: nightly
39+
release_name: Nightly Release
40+
draft: false
41+
prerelease: false
42+
43+
- name: Upload Release Asset
44+
id: upload-release-asset
45+
uses: actions/[email protected]
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
upload_url: ${{ steps.create_release.outputs.upload_url }}
50+
asset_path: dist/tuture-${{ matrix.platform }}.zip
51+
asset_name: tuture-${{ matrix.platform }}.zip
52+
asset_content_type: application/zip

scripts/pack.sh

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,27 @@ rm -rf dist
77
mkdir dist
88

99
# packaging binaries with pkg.
10-
npx pkg -t node8-linux-x64,node8-linux-x86,node8-macos-x64,node8-macos-x86,node8-win-x64,node8-win-x86 .
10+
npx pkg -t node12-linux-x64,node12-macos-x64,node12-win-x64 .
1111

12-
make_tarball() {
12+
make_zip() {
1313
binary=$1
14-
tarball_name=$2
14+
target=$2
1515

1616
mv $binary tuture
17-
tar -czvf dist/$tarball_name tuture
17+
zip -r dist/$target tuture
1818
rm tuture
1919
}
2020

21-
make_win_tarball() {
21+
make_win_zip() {
2222
binary=$1
23-
tarball_name=$2
23+
target=$2
2424

2525
# we have to keep .exe suffix here.
2626
mv $binary tuture.exe
27-
tar -czvf dist/$tarball_name tuture.exe
27+
zip -r dist/$target tuture.exe
2828
rm tuture.exe
2929
}
3030

31-
make_tarball tuture-linux-x64 tuture-linux-x64.tar.gz
32-
make_tarball tuture-linux-x86 tuture-linux-x86.tar.gz
33-
make_tarball tuture-macos-x64 tuture-macos-x64.tar.gz
34-
make_tarball tuture-macos-x86 tuture-macos-x86.tar.gz
35-
make_win_tarball tuture-win-x64.exe tuture-win-x64.tar.gz
36-
make_win_tarball tuture-win-x86.exe tuture-win-x86.tar.gz
31+
make_zip tuture-linux tuture-linux.zip
32+
make_zip tuture-macos tuture-macos.zip
33+
make_win_zip tuture-win.exe tuture-windows.zip

0 commit comments

Comments
 (0)