Skip to content

Commit 960bef3

Browse files
committed
Add release-plz for changelog and version management (resolved conflict: kept full ci.yml with cosign+audit)
2 parents 70465a4 + 9d9b3fc commit 960bef3

3 files changed

Lines changed: 115 additions & 0 deletions

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Release Binaries
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
10+
jobs:
11+
upload-mac-universal-bin:
12+
runs-on: macos-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Build macOS binaries
17+
run: cargo build --release --target aarch64-apple-darwin --target x86_64-apple-darwin
18+
19+
- name: Create universal binary and upload
20+
run: |
21+
# Combine intel and m1 binaries into a single universal binary
22+
lipo -create -output target/pks target/aarch64-apple-darwin/release/pks target/x86_64-apple-darwin/release/pks
23+
24+
# Create tarball for homebrew
25+
tar -czf target/pks-mac.tar.gz -C target pks
26+
27+
# Upload to release
28+
gh release upload ${{ github.event.release.tag_name }} target/pks-mac.tar.gz
29+
env:
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
32+
upload-linux-bin:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- name: Install cross
38+
run: cargo install cross
39+
40+
- name: Build linux binaries
41+
run: |
42+
cross build --release --target x86_64-unknown-linux-gnu
43+
cross build --release --target aarch64-unknown-linux-gnu
44+
45+
- name: Upload linux binaries
46+
run: |
47+
tar -czf target/x86_64-unknown-linux-gnu.tar.gz -C target/x86_64-unknown-linux-gnu/release pks
48+
tar -czf target/aarch64-unknown-linux-gnu.tar.gz -C target/aarch64-unknown-linux-gnu/release pks
49+
gh release upload ${{ github.event.release.tag_name }} target/x86_64-unknown-linux-gnu.tar.gz
50+
gh release upload ${{ github.event.release.tag_name }} target/aarch64-unknown-linux-gnu.tar.gz
51+
env:
52+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
54+
generate-dotslash-files:
55+
name: Generate DotSlash files
56+
needs:
57+
- upload-linux-bin
58+
- upload-mac-universal-bin
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- uses: facebook/dotslash-publish-release@v1
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
with:
67+
config: .github/workflows/dotslash-config.json
68+
tag: ${{ github.event.release.tag_name }}

.github/workflows/release-plz.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release-plz
2+
3+
permissions:
4+
pull-requests: write
5+
contents: write
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
release-plz:
14+
name: Release-plz
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Install Rust toolchain
23+
uses: dtolnay/rust-toolchain@stable
24+
25+
- name: Run release-plz
26+
uses: release-plz/action@v0.5
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release-plz.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[workspace]
2+
# Don't publish to crates.io - binaries are distributed via GitHub releases
3+
publish = false
4+
# Create GitHub releases when release PR is merged
5+
git_release_enable = true
6+
# Generate changelog from conventional commits
7+
changelog_update = true
8+
9+
[changelog]
10+
# Use conventional commits to generate changelog
11+
commit_parsers = [
12+
{ message = "^feat", group = "Features" },
13+
{ message = "^fix", group = "Bug Fixes" },
14+
{ message = "^docs", group = "Documentation" },
15+
{ message = "^perf", group = "Performance" },
16+
{ message = "^refactor", group = "Refactoring" },
17+
{ message = "^test", group = "Testing" },
18+
{ message = "^chore", group = "Miscellaneous" },
19+
]

0 commit comments

Comments
 (0)