Skip to content

Commit 84642c2

Browse files
committed
ci: release workflow fixes (syft, GITHUB_TOKEN, v-strip, tagged bindings)
1 parent 853382f commit 84642c2

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ jobs:
3838
service_account: ${{ vars.DEPLOYER_SA_EMAIL }}
3939
- uses: google-github-actions/setup-gcloud@v2
4040

41+
# goreleaser's `sboms` block shells out to syft; install it so the SBOM step succeeds.
42+
- name: install syft (SBOM)
43+
uses: anchore/sbom-action/download-syft@v0
44+
4145
# google-github-actions/auth writes gha-creds-*.json into the workspace; exclude it so
4246
# goreleaser's clean-tree check does not fail with "git is in a dirty state".
4347
- name: keep the tree clean for goreleaser
@@ -61,7 +65,7 @@ jobs:
6165
- name: publish binaries -> Artifact Registry (generic)
6266
run: |
6367
set -euo pipefail
64-
VER="${GITHUB_REF_NAME}"
68+
VER="${GITHUB_REF_NAME#v}" # strip the leading v; goreleaser archives are named without it
6569
for f in dist/interlock_*.tar.gz dist/interlock_*.zip dist/checksums.txt; do
6670
[ -e "$f" ] || continue
6771
gcloud artifacts generic upload \
@@ -73,7 +77,7 @@ jobs:
7377
- name: update latest channel manifest
7478
run: |
7579
set -euo pipefail
76-
printf '{"version":"%s"}\n' "${GITHUB_REF_NAME}" > latest.json
80+
printf '{"version":"%s"}\n' "${GITHUB_REF_NAME#v}" > latest.json
7781
gcloud artifacts generic upload \
7882
--project="${{ vars.AR_PROJECT }}" --location="${{ vars.AR_LOCATION }}" \
7983
--repository="${{ vars.AR_GENERIC_REPO }}" \
@@ -83,6 +87,7 @@ jobs:
8387
working-directory: clients/typescript
8488
run: |
8589
set -euo pipefail
90+
npm version "${GITHUB_REF_NAME#v}" --no-git-tag-version --allow-same-version
8691
gcloud artifacts print-settings npm \
8792
--project="${{ vars.AR_PROJECT }}" --location="${{ vars.AR_LOCATION }}" \
8893
--repository="${{ vars.AR_NPM_REPO }}" --scope=@operatorstack > .npmrc
@@ -93,6 +98,7 @@ jobs:
9398
working-directory: clients/python
9499
run: |
95100
set -euo pipefail
101+
sed -i "s/^version = .*/version = \"${GITHUB_REF_NAME#v}\"/" pyproject.toml
96102
pip install --quiet build twine keyrings.google-artifactregistry-auth
97103
python -m build
98104
twine upload \

0 commit comments

Comments
 (0)