-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (72 loc) · 2.55 KB
/
build.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
name: Build
on:
push:
branches:
- '**'
tags:
- '**'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: npm install, build
run: |
npm ci
npm run lint
npm run build
npm run pkg
env:
CI: true
- name: Create release
if: "contains(github.ref, 'refs/tags/')"
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset for Linux
if: "contains(github.ref, 'refs/tags/')"
id: upload-release-asset-linux
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./extract-serac-linux
asset_name: extract-serac-linux
asset_content_type: application/octet-stream
- name: Upload Release Asset for Windows
if: "contains(github.ref, 'refs/tags/')"
id: upload-release-asset-windows
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./extract-serac-win.exe
asset_name: extract-serac-win.exe
asset_content_type: application/octet-stream
- name: Upload Release Asset for MacOS
if: "contains(github.ref, 'refs/tags/')" # only on tags
id: upload-release-asset-macos
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./extract-serac-macos
asset_name: extract-serac-macos
asset_content_type: application/octet-stream