-
Notifications
You must be signed in to change notification settings - Fork 7
167 lines (135 loc) · 4.84 KB
/
Copy pathbuild-exe.yml
File metadata and controls
167 lines (135 loc) · 4.84 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Build Executable
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-exe:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- name: Read package version
run: |
VERSION="$(bun -e 'console.log(require("./package.json").version)')"
echo "PACKAGE_VERSION=${VERSION}" >> "$GITHUB_ENV"
- name: Install server dependencies
working-directory: server
run: bun install --frozen-lockfile
- name: Install web dependencies
working-directory: web
run: bun install --frozen-lockfile
- name: Install integration-test dependencies
working-directory: integration-tests
run: bun install --frozen-lockfile
- name: Compile Paraglide messages
working-directory: web
run: bun run i18n:compile
- name: Run checks
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
run: bun run check
- name: Run server tests
run: bun run test:server
- name: Run web tests for release validation
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
run: bun run --cwd web test
- name: Build web app
run: bun run build
- name: Compile executables
run: bun run build-exe:compile --target=linux-x64,windows-x64
- name: Smoke test Linux x64 executable
run: bun run build-exe:smoke:linux-x64
- name: Verify executables exist
run: |
# Leaves Darwin arm64 disabled until the produced binary stops failing Gatekeeper with "damaged and can't be opened".
for executable in dist/garcon-linux-x64 dist/garcon-windows-x64.exe; do
if [ ! -f "$executable" ]; then
echo "Expected executable at $executable"
ls -la dist || true
exit 1
fi
ls -la "$executable"
file "$executable" || true
done
- name: Prepare executable artifacts
run: |
mkdir -p artifacts
cp dist/garcon-linux-x64 "artifacts/garcon-v${PACKAGE_VERSION}-linux-x64"
cp dist/garcon-windows-x64.exe "artifacts/garcon-v${PACKAGE_VERSION}-windows-x64.exe"
ls -la artifacts
- name: Upload Linux x64 executable artifact
uses: actions/upload-artifact@v4
with:
name: garcon-v${{ env.PACKAGE_VERSION }}-linux-x64
path: artifacts/garcon-v${{ env.PACKAGE_VERSION }}-linux-x64
if-no-files-found: error
- name: Upload Windows x64 executable artifact
uses: actions/upload-artifact@v4
with:
name: garcon-v${{ env.PACKAGE_VERSION }}-windows-x64.exe
path: artifacts/garcon-v${{ env.PACKAGE_VERSION }}-windows-x64.exe
if-no-files-found: error
release:
name: Create Release
needs: build-exe
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Read package version
run: |
VERSION="$(bun -e 'console.log(require("./package.json").version)')"
echo "PACKAGE_VERSION=${VERSION}" >> "$GITHUB_ENV"
- name: Download Linux x64 executable artifact
uses: actions/download-artifact@v4
with:
name: garcon-v${{ env.PACKAGE_VERSION }}-linux-x64
path: artifacts
- name: Download Windows x64 executable artifact
uses: actions/download-artifact@v4
with:
name: garcon-v${{ env.PACKAGE_VERSION }}-windows-x64.exe
path: artifacts
- name: Package release assets
run: |
for artifact in "garcon-v${PACKAGE_VERSION}-linux-x64" "garcon-v${PACKAGE_VERSION}-windows-x64.exe"; do
if [ ! -f "artifacts/${artifact}" ]; then
echo "Missing downloaded executable artifact: ${artifact}"
ls -la artifacts || true
exit 1
fi
(
cd artifacts
zip -q "${artifact}.zip" "${artifact}"
)
done
- name: List release artifacts
run: |
echo "Downloaded artifacts:"
find artifacts -type f -name '*.zip' | sort
- name: Create release
uses: softprops/action-gh-release@v2
with:
files: artifacts/*.zip
draft: true
generate_release_notes: true