-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (62 loc) · 2.16 KB
/
Copy pathrelease.yml
File metadata and controls
76 lines (62 loc) · 2.16 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
name: Release
on:
push:
tags: ["v*"]
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: macos-15
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Build release binary
run: swift build -c release
- name: Verify version
run: |
SOURCE_VERSION=$(.build/release/Herald --version)
TAG_VERSION=${GITHUB_REF_NAME#v}
if [ "$SOURCE_VERSION" != "$TAG_VERSION" ]; then
echo "Version mismatch: Version.swift=$SOURCE_VERSION, tag=$TAG_VERSION"
exit 1
fi
- name: Build app bundle
run: ./scripts/build-app.sh
- name: Test
run: swift test
- name: Create tarball
run: |
tar -czvf herald-${{ github.ref_name }}.tar.gz -C .build Herald.app -C ${{ github.workspace }} README.md LICENSE
- name: Checksum
id: checksum
run: |
SHA=$(shasum -a 256 herald-${{ github.ref_name }}.tar.gz | awk '{print $1}')
echo "sha256=$SHA" >> $GITHUB_OUTPUT
echo "$SHA herald-${{ github.ref_name }}.tar.gz" > herald-${{ github.ref_name }}.tar.gz.sha256
- name: Install git-cliff
uses: taiki-e/install-action@v2
with:
tool: git-cliff
- name: Generate changelog
run: git cliff --latest --strip header > CHANGELOG.md
- name: Create release
uses: softprops/action-gh-release@v2
with:
files: |
herald-${{ github.ref_name }}.tar.gz
herald-${{ github.ref_name }}.tar.gz.sha256
body_path: CHANGELOG.md
generate_release_notes: false
- name: Update Homebrew tap
uses: mislav/bump-homebrew-formula-action@v4
with:
formula-name: herald
homebrew-tap: mdsakalu/homebrew-tap
download-url: https://github.com/mdsakalu/herald/releases/download/${{ github.ref_name }}/herald-${{ github.ref_name }}.tar.gz
download-sha256: ${{ steps.checksum.outputs.sha256 }}
env:
COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}