-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.43 KB
/
release.yml
File metadata and controls
59 lines (49 loc) · 1.43 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
name: Release Windows Installer
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
publish:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.10
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Validate tag matches package version
shell: pwsh
run: |
$pkg = Get-Content package.json -Raw | ConvertFrom-Json
$expected = "v$($pkg.version)"
$refName = "${{ github.ref_name }}"
$fullRef = "${{ github.ref }}"
$tag = if ($refName -like 'refs/tags/*') {
$refName.Substring(10)
} elseif ($fullRef -like 'refs/tags/*') {
$fullRef.Substring(10)
} else {
$refName
}
if ($tag -ne $expected) {
throw "Tag '$tag' does not match package.json version '$expected'"
}
- name: Build and publish release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun run dist:publish
- name: Show generated artifacts
shell: pwsh
run: Get-ChildItem -Recurse release | Select-Object FullName, Length | Format-Table -AutoSize