Repository navigation
136 lines (136 loc) · 5.01 KB
/
Copy pathrelease.yml
File metadata and controls
136 lines (136 loc) · 5.01 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Release
on:
push:
tags: ['v*']
workflow_dispatch:
inputs:
publish:
description: Publish the checked CLI version
type: boolean
default: false
permissions:
contents: read
concurrency:
group: release
cancel-in-progress: false
jobs:
check:
uses: ./.github/workflows/ci.yml
version:
runs-on: ubuntu-24.04
timeout-minutes: 5
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- id: version
run: python3 scripts/release-version.py
build:
needs: [check, version]
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-24.04
target: x86_64-unknown-linux-musl
- runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl
- runner: macos-15-intel
target: x86_64-apple-darwin
- runner: windows-2025
target: x86_64-pc-windows-msvc
- runner: macos-15
target: aarch64-apple-darwin
runs-on: ${{ matrix.runner }}
timeout-minutes: 30
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install --no-install-recommends --yes musl-tools
- env:
TARGET: ${{ matrix.target }}
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER: musl-gcc
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: musl-gcc
CC_x86_64_unknown_linux_musl: musl-gcc
CC_aarch64_unknown_linux_musl: musl-gcc
run: |
rustup target add "$TARGET"
cargo build --release --locked --target "$TARGET"
- env:
TARGET: ${{ matrix.target }}
VERSION: ${{ needs.version.outputs.version }}
run: |
binary=proofline
if [[ "$TARGET" == *windows* ]]; then binary=proofline.exe; fi
test "$(target/"$TARGET"/release/"$binary" --version)" = "proofline $VERSION"
if [[ "$TARGET" == x86_64-unknown-linux-musl && -f install.sh ]]; then
sh -n install.sh
grep -Fxq "PROOFLINE_INSTALLER_VERSION=$VERSION" install.sh
if grep -q '^PROOFLINE_SETUP_MIN_VERSION=' install.sh; then
minimum=$(sed -n 's/^PROOFLINE_SETUP_MIN_VERSION=//p' install.sh)
[[ "$minimum" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]
[[ "$(printf '%s\n%s\n' "$minimum" "$VERSION" | sort -V | tail -1)" == "$VERSION" ]]
"target/$TARGET/release/proofline" agent install claude-code --print > /dev/null
fi
fi
python3 scripts/archive.py "$TARGET"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: cli-${{ matrix.target }}
path: artifacts/*.tar.gz
if-no-files-found: error
publish:
if: github.event_name == 'push' || inputs.publish
needs: [version, build]
runs-on: ubuntu-24.04
timeout-minutes: 15
environment: release
permissions:
contents: write
id-token: write
attestations: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: cli-*
merge-multiple: true
path: artifacts
- env:
VERSION: ${{ needs.version.outputs.version }}
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
test "$(find artifacts -name '*.tar.gz' | wc -l)" -eq 5
(cd artifacts && LC_ALL=C sha256sum proofline-*.tar.gz > SHA256SUMS)
printf '%s\n' "$VERSION" > artifacts/latest
if [[ -f install.sh ]]; then cp install.sh artifacts/install.sh; fi
python3 scripts/github-assets.py "$VERSION" artifacts
- uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
with:
subject-path: artifacts/*.tar.gz
- env:
VERSION: ${{ needs.version.outputs.version }}
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
CLI_RELEASE_R2_CREDENTIALS: ${{ secrets.CLI_RELEASE_R2_CREDENTIALS }}
run: scripts/publish-r2.sh "$VERSION" artifacts
- env:
VERSION: ${{ needs.version.outputs.version }}
GH_TOKEN: ${{ github.token }}
run: |
gh release edit "v$VERSION" --repo "$GITHUB_REPOSITORY" --draft=false --latest
for archive in artifacts/*.tar.gz; do
name=$(basename "$archive")
curl --proto '=https' --tlsv1.2 --fail --silent --show-error --location "https://proofline.sh/cli/download/$VERSION/$name" -o "/tmp/$name"
cmp "$archive" "/tmp/$name"
done