Skip to content

Commit a31a6da

Browse files
committed
[workflow] Job to upload macOS binary
1 parent e54b749 commit a31a6da

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permissions:
77
contents: write
88

99
jobs:
10-
check_release:
10+
create_release:
1111
name: Check whether ready for release
1212
runs-on: ubuntu-latest
1313

@@ -31,3 +31,18 @@ jobs:
3131
env:
3232
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3333
run: python3 scripts/release.py create
34+
35+
macos_binary:
36+
name: Build and upload macOS binary
37+
runs-on: macos-latest
38+
needs: create_release
39+
40+
steps:
41+
- uses: actions/checkout@v4
42+
with:
43+
submodules: true
44+
45+
- name: Install x86_64 target
46+
run: rustup target add x86_64-apple-darwin
47+
48+
- run: python3 scripts/upload_macos.sh

scripts/release.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ def create(args: argparse.Namespace):
183183

184184
def upload(args: argparse.Namespace):
185185
version = get_tagged_version("HEAD")
186-
subprocess.run(["gh", "release", "upload", f"v{version}", args.file], check=True)
186+
subprocess.run(
187+
["gh", "release", "upload", "--clobber", f"v{version}", args.file], check=True
188+
)
187189

188190

189191
def main():
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ set -e
77
cargo build -r
88
cargo build -r --target x86_64-apple-darwin
99
lipo -create -output coursepointer target/release/coursepointer target/x86_64-apple-darwin/release/coursepointer
10-
zip coursepointer-macos.zip coursepointer docs/third_party_licenses.md
10+
zip -j coursepointer-macos.zip coursepointer docs/third_party_licenses.md
1111
python3 scripts/release.py upload coursepointer-macos.zip

0 commit comments

Comments
 (0)