-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (74 loc) · 2.56 KB
/
Copy pathrelease.yml
File metadata and controls
88 lines (74 loc) · 2.56 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
77
78
79
80
81
82
83
84
85
86
87
88
name: Release
on:
release:
types: [published]
permissions:
contents: write
jobs:
package:
name: Package ${{ matrix.asset_suffix }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- runner: macos-15
asset_suffix: macos-arm64
env:
CARGO_TERM_COLOR: always
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
- name: Show toolchain versions
run: |
uname -m
rustc --version
cargo --version
- name: Build release binary
run: cargo build -p face --release --locked
- name: Package release archive
run: bash .github/scripts/package-release.sh "${{ github.event.release.tag_name }}" "${{ matrix.asset_suffix }}"
- name: Upload release assets
uses: softprops/action-gh-release@v2
with:
files: |
dist/face-${{ github.event.release.tag_name }}-${{ matrix.asset_suffix }}.tar.gz
dist/face-${{ github.event.release.tag_name }}-${{ matrix.asset_suffix }}.sha256
update-homebrew-tap:
name: Update Homebrew tap
runs-on: ubuntu-24.04
needs: package
env:
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
steps:
- name: Skip when tap token is unavailable
if: ${{ env.HOMEBREW_TAP_TOKEN == '' }}
run: echo "HOMEBREW_TAP_TOKEN is not configured; skipping tap update."
- name: Check out tap repository
if: ${{ env.HOMEBREW_TAP_TOKEN != '' }}
uses: actions/checkout@v4
with:
repository: oops-rs/homebrew-tap
ref: main
token: ${{ env.HOMEBREW_TAP_TOKEN }}
path: tap
- name: Update face formula
if: ${{ env.HOMEBREW_TAP_TOKEN != '' }}
run: bash tap/scripts/update-formula.sh face "${{ github.event.release.tag_name }}"
- name: Commit updated formula
if: ${{ env.HOMEBREW_TAP_TOKEN != '' }}
run: |
if [ -z "$(git -C tap status --porcelain -- Formula)" ]; then
echo "face formula already up to date"
exit 0
fi
git -C tap config user.name "github-actions[bot]"
git -C tap config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git -C tap add Formula
git -C tap commit -m "face ${GITHUB_REF_NAME}"
git -C tap push origin HEAD:main