-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (60 loc) · 2.21 KB
/
Copy pathrelease.yml
File metadata and controls
70 lines (60 loc) · 2.21 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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
runs-on: macos-14
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Verify tag and version
shell: bash
run: |
set -euo pipefail
version="$(cat VERSION)"
test "$GITHUB_REF_NAME" = "v$version"
PYTHONPATH=src python -c 'import agent_switch; print(agent_switch.__version__)'
- name: Run release tests
run: |
PYTHONPATH=src python -m unittest discover -s tests -v
PYTHONPATH=src python -m unittest discover -s tests/integration -v
- name: Build release artifacts
run: |
python -m pip install --upgrade build
python -m build --sdist --outdir dist
./scripts/build-release.sh dist
cd dist
shasum -a 256 "agent_switch-$(cat ../VERSION).tar.gz" \
> "agent_switch-$(cat ../VERSION).tar.gz.sha256"
- name: Create GitHub prerelease
env:
GH_TOKEN: ${{ github.token }}
shell: bash
run: |
set -euo pipefail
version="$(cat VERSION)"
cat > "$RUNNER_TEMP/release-notes.md" <<EOF
Agent Switch $version is an alpha release for macOS 14 and newer.
## Install
\`\`\`bash
brew tap JNHFlow21/tap && brew trust --tap JNHFlow21/tap && brew install --cask JNHFlow21/tap/agent-switch
\`\`\`
This build is ad-hoc signed and not notarized because the project does
not yet have an Apple Developer ID. The project-owned Cask removes
Gatekeeper quarantine after installation. Review the public source and
checksums before installing.
EOF
gh release create "$GITHUB_REF_NAME" \
dist/Agent-Switch-"$version"-macos-universal.zip \
dist/Agent-Switch-"$version"-macos-universal.zip.sha256 \
dist/agent_switch-"$version".tar.gz \
dist/agent_switch-"$version".tar.gz.sha256 \
--title "Agent Switch $version" \
--notes-file "$RUNNER_TEMP/release-notes.md" \
--prerelease