-
Notifications
You must be signed in to change notification settings - Fork 10
82 lines (67 loc) · 1.91 KB
/
release.yml
File metadata and controls
82 lines (67 loc) · 1.91 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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
strategy:
matrix:
include:
- target: bun-darwin-arm64
artifact: polar-darwin-arm64
os: ubuntu-latest
ext: tar.gz
binary: polar
- target: bun-darwin-x64
artifact: polar-darwin-x64
os: ubuntu-latest
ext: tar.gz
binary: polar
- target: bun-linux-x64
artifact: polar-linux-x64
os: ubuntu-latest
ext: tar.gz
binary: polar
- target: bun-windows-x64
artifact: polar-windows-x64
os: ubuntu-latest
ext: zip
binary: polar.exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install
- name: Build binary
run: bun build ./src/cli.ts --compile --target=${{ matrix.target }} --outfile ${{ matrix.binary }}
- name: Package binary (tar.gz)
if: matrix.ext == 'tar.gz'
run: tar -czf ${{ matrix.artifact }}.tar.gz ${{ matrix.binary }}
- name: Package binary (zip)
if: matrix.ext == 'zip'
run: zip ${{ matrix.artifact }}.zip ${{ matrix.binary }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}.${{ matrix.ext }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Generate checksums
run: sha256sum polar-* > checksums.txt
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
polar-*
checksums.txt
generate_release_notes: true