Skip to content

Commit 195fbf0

Browse files
runningcodeclaude
andcommitted
ref(ci): Remove skip-signing and fix snapshot versioning
Remove the skip-signing input from build.yml since snapshots should go through the same signing pipeline as releases. Also switch snapshot versioning from minor bump to patch bump and use cargo metadata for more reliable version parsing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2cea920 commit 195fbf0

2 files changed

Lines changed: 9 additions & 16 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ on:
66
- release/**
77
workflow_call:
88
inputs:
9-
skip-signing:
10-
type: boolean
11-
default: false
129
is-snapshot:
1310
type: boolean
1411
default: false
@@ -169,13 +166,11 @@ jobs:
169166

170167
steps:
171168
- name: Checkout repository
172-
if: ${{ !inputs.skip-signing }}
173169
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
174170
with:
175171
ref: ${{ inputs.checkout-ref }}
176172

177173
- name: Install `rcodesign`
178-
if: ${{ !inputs.skip-signing }}
179174
run: |
180175
curl -L https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign%2F0.29.0/apple-codesign-0.29.0-x86_64-unknown-linux-musl.tar.gz \
181176
-o rcodesign.tar.gz
@@ -185,7 +180,6 @@ jobs:
185180
rm rcodesign.tar.gz
186181
187182
- name: Decode Apple signing certificate and API key
188-
if: ${{ !inputs.skip-signing }}
189183
env:
190184
APPLE_CERT_DATA: ${{ secrets.APPLE_CERT_DATA }}
191185
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
@@ -199,7 +193,6 @@ jobs:
199193
name: unsigned-bin-macos-${{ matrix.arch }}
200194

201195
- name: Sign binary
202-
if: ${{ !inputs.skip-signing }}
203196
run: |
204197
rcodesign sign \
205198
--for-notarization \
@@ -209,12 +202,10 @@ jobs:
209202
sentry-cli-Darwin-${{ matrix.arch }}
210203
211204
- name: Zip signed binary
212-
if: ${{ !inputs.skip-signing }}
213205
run: |
214206
zip sentry-cli-Darwin-${{ matrix.arch }}.zip sentry-cli-Darwin-${{ matrix.arch }}
215207
216208
- name: Notarize binary
217-
if: ${{ !inputs.skip-signing }}
218209
run: |
219210
rcodesign notary-submit \
220211
--api-key-file ${{ env.APPLE_API_KEY_PATH }} \

.github/workflows/snapshot.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,22 @@ jobs:
1717
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
1818

1919
# Computes a semver-compliant snapshot version based on the current
20-
# version in Cargo.toml. The minor version is bumped so that the
20+
# version in Cargo.toml. The patch version is bumped so that the
2121
# snapshot sorts higher than the current release but lower than the
2222
# next real release. For example, if Cargo.toml has 3.3.1, the
23-
# snapshot version will be 3.4.0-snapshot.20260312.abc1234.
23+
# snapshot version will be 3.3.2-snapshot.20260312.abc1234.
2424
- name: Compute snapshot version
2525
id: version
2626
run: |
27-
CURRENT=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
27+
CURRENT=$(cargo metadata --no-deps --format-version 1 \
28+
| jq -er '(.workspace_default_members[0]) as $id | .packages[] | select(.id == $id) | .version')
2829
MAJOR=$(echo "$CURRENT" | cut -d. -f1)
2930
MINOR=$(echo "$CURRENT" | cut -d. -f2)
30-
NEXT_MINOR=$((MINOR + 1))
31+
PATCH=$(echo "$CURRENT" | cut -d. -f3)
32+
NEXT_PATCH=$((PATCH + 1))
3133
DATE=$(date -u +%Y%m%d)
3234
SHORT_SHA=$(git rev-parse --short HEAD)
33-
VERSION="${MAJOR}.${NEXT_MINOR}.0-snapshot.${DATE}.${SHORT_SHA}"
35+
VERSION="${MAJOR}.${MINOR}.${NEXT_PATCH}-snapshot.${DATE}.${SHORT_SHA}"
3436
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
3537
echo "current=$CURRENT" >> "$GITHUB_OUTPUT"
3638
echo "Snapshot version: $VERSION"
@@ -59,7 +61,6 @@ jobs:
5961
needs: prepare
6062
uses: ./.github/workflows/build.yml
6163
with:
62-
skip-signing: true
6364
is-snapshot: true
6465
checkout-ref: ${{ needs.prepare.outputs.ref }}
6566
secrets: inherit
@@ -108,7 +109,8 @@ jobs:
108109
runs-on: ubuntu-24.04
109110
steps:
110111
- name: Delete snapshot branch
112+
if: needs.prepare.outputs.ref != ''
111113
env:
112114
GH_TOKEN: ${{ github.token }}
113115
run: |
114-
gh api -X DELETE "repos/${{ github.repository }}/git/refs/heads/${{ needs.prepare.outputs.ref }}" || true
116+
gh api -X DELETE "repos/${{ github.repository }}/git/refs/heads/${{ needs.prepare.outputs.ref }}"

0 commit comments

Comments
 (0)