-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (80 loc) · 2.53 KB
/
Copy pathrelease.yml
File metadata and controls
84 lines (80 loc) · 2.53 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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-15
target: aarch64-apple-darwin
executable: codex-home-guard
- os: macos-15-intel
target: x86_64-apple-darwin
executable: codex-home-guard
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
executable: codex-home-guard
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
executable: codex-home-guard
- os: windows-latest
target: x86_64-pc-windows-msvc
executable: codex-home-guard.exe
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: codex/hooks/home-guard
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- name: Test
run: cargo test --locked
- name: Build
run: cargo build --release --locked
- name: Package Unix
if: runner.os != 'Windows'
shell: bash
run: |
mkdir -p package
cp "target/release/${{ matrix.executable }}" package/codex-home-guard
tar -czf "codex-home-guard-${{ matrix.target }}.tar.gz" -C package codex-home-guard
- name: Package Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
New-Item -ItemType Directory -Force package
Copy-Item "target/release/${{ matrix.executable }}" "package/codex-home-guard.exe"
Compress-Archive -Path "package/codex-home-guard.exe" -DestinationPath "codex-home-guard-${{ matrix.target }}.zip"
- uses: actions/upload-artifact@v4
with:
name: codex-home-guard-${{ matrix.target }}
path: codex/hooks/home-guard/codex-home-guard-${{ matrix.target }}.*
if-no-files-found: error
publish:
name: Publish GitHub release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v5
with:
path: dist
merge-multiple: true
- name: Generate checksums
working-directory: dist
run: sha256sum codex-home-guard-* > checksums.txt
- name: Publish
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "$GITHUB_REF_NAME" dist/* \
--title "$GITHUB_REF_NAME" \
--generate-notes \
--verify-tag