-
Notifications
You must be signed in to change notification settings - Fork 39
87 lines (79 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
name: release
on:
push:
tags:
- 'v[0-9]+.*'
jobs:
create-release:
name: create-release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
steps:
- name: Get the release version from the tag
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#*/*/}
- name: Create GitHub release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: Release ${{ steps.get_version.outputs.VERSION }}
build-release:
runs-on: ubuntu-latest
needs: [create-release]
steps:
- uses: actions/checkout@v3
- name: Install NPM dependencies
run: npm install
- name: Build project assets
run: npm run build-binary
- name: Compress Linux binary
run: mkdir perlnavigator-linux-x86_64 && cp -a dist/perlnavigator-linux perlnavigator-linux-x86_64/perlnavigator && zip -r perlnavigator-linux-x86_64.zip perlnavigator-linux-x86_64
- name: Upload Linux binary
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: perlnavigator-linux-x86_64.zip
asset_name: perlnavigator-linux-x86_64.zip
asset_content_type: application/octet-stream
- name: Compress MacOS binary
run: mkdir perlnavigator-macos-x86_64 && cp -a dist/perlnavigator-macos perlnavigator-macos-x86_64/perlnavigator && zip -r perlnavigator-macos-x86_64.zip perlnavigator-macos-x86_64
- name: Upload MacOS binary
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: perlnavigator-macos-x86_64.zip
asset_name: perlnavigator-macos-x86_64.zip
asset_content_type: application/octet-stream
- name: Compress Windows binary
run: mkdir perlnavigator-win-x86_64 && cp -a dist/perlnavigator-win.exe perlnavigator-win-x86_64/perlnavigator.exe && zip -r perlnavigator-win-x86_64.zip perlnavigator-win-x86_64
- name: Upload Windows binary
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: perlnavigator-win-x86_64.zip
asset_name: perlnavigator-win-x86_64.zip
asset_content_type: application/octet-stream
publish-release:
needs: [build-release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: tsc -b
- run: npm publish server/
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}