-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (103 loc) · 3.15 KB
/
Copy pathrelease.yml
File metadata and controls
122 lines (103 loc) · 3.15 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
name: Release
# Every merge to main bumps the patch version (derived from commit count),
# builds all platforms, and publishes a GitHub Release with the binaries.
# The version tag is created by the release step, pointing at the commit
# that triggered this workflow.
on:
push:
branches: [main]
concurrency:
group: release-main
cancel-in-progress: true
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm test
version:
needs: test
runs-on: ubuntu-latest
outputs:
version: ${{ steps.compute.outputs.version }}
tag: ${{ steps.compute.outputs.tag }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- id: compute
run: |
BASE=$(cat VERSION | tr -d '[:space:]')
PATCH=$(git rev-list --count HEAD)
VERSION="${BASE}.${PATCH}"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "tag=v${VERSION}" >> "$GITHUB_OUTPUT"
build:
needs: version
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
script: build:linux
- os: macos-latest
script: build:mac
- os: windows-latest
script: build:win
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm version --no-git-tag-version ${{ needs.version.outputs.version }}
- run: npm run ${{ matrix.script }}
env:
CSC_LINK: ${{ matrix.os == 'macos-latest' && secrets.CSC_LINK || '' }}
CSC_KEY_PASSWORD: ${{ matrix.os == 'macos-latest' && secrets.CSC_KEY_PASSWORD || '' }}
APPLE_ID: ${{ matrix.os == 'macos-latest' && secrets.APPLE_ID || '' }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ matrix.os == 'macos-latest' && secrets.APPLE_APP_SPECIFIC_PASSWORD || '' }}
APPLE_TEAM_ID: ${{ matrix.os == 'macos-latest' && secrets.APPLE_TEAM_ID || '' }}
- uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}
path: |
dist/*.dmg
dist/*.AppImage
dist/*-setup.exe
dist/latest*.yml
if-no-files-found: warn
release:
needs: [version, build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: dist-*
merge-multiple: true
path: release-files
- name: Generate checksums
run: |
cd release-files
sha256sum * > SHA256SUMS.txt
cat SHA256SUMS.txt
- run: |
gh release create "$TAG" \
--repo "$GITHUB_REPOSITORY" \
--title "BucketLine $TAG" \
--target "$COMMIT" \
--generate-notes \
release-files/*
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ needs.version.outputs.tag }}
COMMIT: ${{ github.sha }}