-
Notifications
You must be signed in to change notification settings - Fork 2
97 lines (82 loc) · 2.92 KB
/
release.yml
File metadata and controls
97 lines (82 loc) · 2.92 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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g., 1.0.0)'
required: true
type: string
jobs:
build:
strategy:
matrix:
include:
- os: macos-latest
target: darwin-x64
- os: macos-latest
target: darwin-arm64
- os: ubuntu-latest
target: linux-x64
- os: ubuntu-latest
target: linux-arm64
- os: windows-latest
target: windows-x64
runs-on: ${{ matrix.os }}
name: Build ${{ matrix.target }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Build binary (Unix)
if: matrix.os != 'windows-latest'
run: bun build ./packages/cli/src/index.ts --compile --target=bun-${{ matrix.target }} --outfile thermoprint-${{ matrix.target }}
- name: Build binary (Windows)
if: matrix.os == 'windows-latest'
run: bun build ./packages/cli/src/index.ts --compile --target=bun-${{ matrix.target }} --outfile thermoprint-${{ matrix.target }}.exe
- name: Upload artifact (Unix)
if: matrix.os != 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: thermoprint-${{ matrix.target }}
path: thermoprint-${{ matrix.target }}
- name: Upload artifact (Windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: thermoprint-${{ matrix.target }}
path: thermoprint-${{ matrix.target }}.exe
release:
needs: build
runs-on: ubuntu-latest
name: Create Release
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Prepare release assets
run: |
mkdir -p release
cp artifacts/thermoprint-darwin-x64/thermoprint-darwin-x64 release/
cp artifacts/thermoprint-darwin-arm64/thermoprint-darwin-arm64 release/
cp artifacts/thermoprint-linux-x64/thermoprint-linux-x64 release/
cp artifacts/thermoprint-linux-arm64/thermoprint-linux-arm64 release/
cp artifacts/thermoprint-windows-x64/thermoprint-windows-x64.exe release/
chmod +x release/thermoprint-darwin-* release/thermoprint-linux-*
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ inputs.version }}
name: Release v${{ inputs.version }}
generate_release_notes: true
files: |
release/thermoprint-darwin-x64
release/thermoprint-darwin-arm64
release/thermoprint-linux-x64
release/thermoprint-linux-arm64
release/thermoprint-windows-x64.exe