-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (75 loc) · 2.63 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
name: Release
on: [workflow_dispatch]
jobs:
tag:
runs-on: ubuntu-latest
outputs:
new_tag: ${{ steps.tag_version.outputs.new_tag }}
upload_url: ${{ steps.release_action.outputs.upload_url }}
steps:
- uses: actions/checkout@v2
- name: Push Tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
id: create_release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
draft: false
release:
runs-on: ubuntu-latest
needs: tag
strategy:
matrix:
goos: [darwin, linux, windows]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: "18.17.1"
- name: Install SQLite3 dependencies (Linux only)
if: matrix.goos == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y sqlite3 libsqlite3-dev build-essential
- name: Install NPM packages
run: cd ui && rm package-lock.json && npm install
- name: Build the project
run: cd ui && npm run build
- name: Build Release Binary
env:
CGO_ENABLED: 1
GOOS: ${{ matrix.goos }}
GOARCH: amd64
CC: ${{ matrix.goos == 'linux' && 'gcc' || matrix.goos == 'darwin' && 'clang' || 'x86_64-w64-mingw32-gcc' }}
CXX: ${{ matrix.goos == 'linux' && 'g++' || matrix.goos == 'darwin' && 'clang++' || 'x86_64-w64-mingw32-g++' }}
run: |
echo "Building for $GOOS..."
go build -tags=prod -o fitwave ./cmd/fitwave
ls -lh
file fitwave
tar -czvf fitwave_${{ needs.tag.outputs.new_tag }}_${{ matrix.goos }}_amd64.tar.gz fitwave
ls -lh
- name: Upload Release Binary
id: upload-go-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.tag.outputs.upload_url }}
asset_path: ./fitwave_${{ needs.tag.outputs.new_tag }}_${{ matrix.goos }}_amd64.tar.gz
asset_name: fitwave_${{ needs.tag.outputs.new_tag }}_${{ matrix.goos }}_amd64.tar.gz
asset_content_type: application/gzip