Skip to content

Commit 1e27a2c

Browse files
committed
Add release CI for mac
The skeleton was copied from https://github.com/Saghen/blink.cmp/blob/main/.github/workflows/release.yaml
1 parent 953ba12 commit 1e27a2c

File tree

1 file changed

+67
-15
lines changed

1 file changed

+67
-15
lines changed

.github/workflows/release.yml

Lines changed: 67 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,75 @@
1+
name: Release
2+
13
on:
2-
release:
3-
types: [created]
4+
push:
5+
tags:
6+
- "v*"
47

58
jobs:
6-
release:
7-
name: release ${{ matrix.target }}
8-
runs-on: ubuntu-24.04
9+
build:
10+
name: Build ${{ matrix.target }}
11+
runs-on: ${{ matrix.os }}
12+
permissions:
13+
contents: read
914
strategy:
10-
fail-fast: false
1115
matrix:
12-
target: [x86_64-unknown-linux-musl]
16+
include:
17+
## Linux builds
18+
# Musl 1.2.3
19+
- os: ubuntu-latest
20+
target: x86_64-unknown-linux-musl
21+
artifact_name: target/x86_64-unknown-linux-musl/release/richclip
22+
23+
## macOS builds
24+
- os: macos-latest
25+
target: x86_64-apple-darwin
26+
artifact_name: target/x86_64-apple-darwin/release/richclip
27+
- os: macos-latest
28+
target: aarch64-apple-darwin
29+
artifact_name: target/aarch64-apple-darwin/release/richclip
30+
1331
steps:
1432
- uses: actions/checkout@v4
15-
- name: Compile and release
16-
uses: rust-build/[email protected]
17-
env:
18-
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
19-
ARCHIVE_TYPES: tar.gz
2033
with:
21-
RUSTTARGET: ${{ matrix.target }}
22-
TOOLCHAIN_VERSION: 1.83.0
23-
PRE_BUILD: ".github/workflows/release_pre_build.sh"
34+
persist-credentials: false
35+
36+
- name: Build binary
37+
uses: houseabsolute/actions-rust-cross@v1
38+
with:
39+
command: build
40+
target: ${{ matrix.target }}
41+
args: "--locked --release"
42+
strip: true
43+
44+
- name: Upload artifacts
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: ${{ matrix.target }}
48+
path: ${{ matrix.target }}.*
49+
50+
release:
51+
name: Release
52+
needs: build
53+
runs-on: ubuntu-latest
54+
permissions:
55+
contents: write
56+
steps:
57+
- name: Download artifacts
58+
uses: actions/download-artifact@v4
59+
60+
- name: Generate checksums
61+
run: |
62+
for file in ./**/*; do
63+
sha256sum "$file" > "${file}.sha256"
64+
done
65+
66+
- name: Upload Release Assets
67+
uses: softprops/action-gh-release@v2
68+
with:
69+
name: ${{ github.ref_name }}
70+
tag_name: ${{ github.ref_name }}
71+
token: ${{ github.token }}
72+
files: ./**/*
73+
draft: true
74+
prerelease: false
75+
generate_release_notes: true

0 commit comments

Comments
 (0)