-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.76 KB
/
Copy pathrelease.yml
File metadata and controls
62 lines (53 loc) · 1.76 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
name: Build and Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag_name:
description: 'Version tag (e.g., v1.0.1)'
required: true
default: 'v0.0.0'
jobs:
build-and-release:
runs-on: macos-latest
outputs:
version: ${{ steps.get_meta.outputs.version }}
hash: ${{ steps.get_meta.outputs.hash }}
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
- name: Build for Release
run: cargo build --release --target=aarch64-apple-darwin
- name: Package Binary
run: |
cd target/aarch64-apple-darwin/release
chmod +x glyphlow
tar -czf glyphlow.tar.gz glyphlow
- name: Calculate Metadata
id: get_meta
run: |
TAG_NAME=${{ github.event.inputs.tag_name || github.ref_name }}
VERSION=${TAG_NAME#v}
HASH=$(shasum -a 256 target/aarch64-apple-darwin/release/glyphlow.tar.gz | cut -d ' ' -f 1 | xxd -r -p | base64)
SRI_HASH="sha256-$HASH"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "hash=$SRI_HASH" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ github.event.inputs.tag_name || github.ref_name }}
files: target/aarch64-apple-darwin/release/glyphlow.tar.gz
generate_release_notes: true
call-update-nix:
needs: build-and-release
uses: ./.github/workflows/update-nix.yml
with:
version: ${{ needs.build-and-release.outputs.version }}
hash: ${{ needs.build-and-release.outputs.hash }}
secrets: inherit