-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (92 loc) · 2.7 KB
/
Copy pathrelease.yml
File metadata and controls
107 lines (92 loc) · 2.7 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
runs-on: macos-latest
strategy:
matrix:
include:
- target: bun-darwin-arm64
platform: darwin-aarch64
- target: bun-darwin-x64
platform: darwin-x64
- target: bun-linux-x64
platform: linux-x64
- target: bun-linux-arm64
platform: linux-aarch64
- target: bun-linux-x64-musl
platform: linux-x64-musl
- target: bun-linux-arm64-musl
platform: linux-aarch64-musl
- target: bun-windows-x64
platform: windows-x64
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Run tests
run: bun test src/
- name: Extract version from package.json
id: version
run: |
VERSION=$(bun -e "import pkg from './package.json'; console.log(pkg.version)")
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "📦 Version: $VERSION"
- name: Build for ${{ matrix.platform }}
run: |
mkdir -p staging
if [[ "${{ matrix.platform }}" == windows-* ]]; then
OUTFILE="staging/biu.exe"
else
OUTFILE="staging/biu"
fi
bun build biu.ts \
--compile \
--minify \
--target ${{ matrix.target }} \
--outfile "$OUTFILE"
- name: Package zip
run: |
mkdir -p release
cp USAGE.md staging/
cd staging
# Unversioned name so installers can use
# https://github.com/<repo>/releases/latest/download/<asset>
ZIP_NAME="biu-${{ matrix.platform }}.zip"
zip -r "../release/$ZIP_NAME" .
echo "📦 Created: $ZIP_NAME"
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: biu-${{ matrix.platform }}
path: ./release/*.zip
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Prepare release files
run: |
mkdir -p release
for dir in ./artifacts/*/; do
cp "$dir"*.zip ./release/ 2>/dev/null || true
done
ls -lh ./release/
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: ./release/*.zip