Skip to content

Commit e9d037c

Browse files
authored
Merge pull request #360 from cipherstash/ci/run-minimal-release-workflow-on-change
ci: run as much of release workflow as possible in PRs
2 parents 5321358 + 2d5fde1 commit e9d037c

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
name: Release
22
on:
3-
push:
3+
push: # publish to `main` tag on Docker Hub on merge to main: https://hub.docker.com/layers/cipherstash/proxy/main
44
branches:
55
- main
6-
release:
6+
pull_request: # run the release workflow when changes are made to it in PRs
7+
branches:
8+
- main
9+
paths:
10+
- '.github/workflows/release.yml'
11+
release: # for cutting a numbered release (e.g. v2.1.9)
712
types: [published]
8-
workflow_dispatch:
13+
workflow_dispatch: # for running the workflow on an arbitrary branch or commit
914

1015
env:
1116
REGISTRY_IMAGE: cipherstash/proxy
@@ -17,8 +22,8 @@ jobs:
1722
fail-fast: false
1823
matrix:
1924
build:
20-
- { os: blacksmith-16vcpu-ubuntu-2204, docker_platform: linux/amd64, rust_target: "x86_64-unknown-linux-gnu" }
21-
- { os: blacksmith-16vcpu-ubuntu-2404-arm, docker_platform: linux/arm64, rust_target: "aarch64-unknown-linux-gnu" }
25+
- { os: blacksmith-16vcpu-ubuntu-2404, docker_platform: linux/amd64, rust_target: "x86_64-unknown-linux-gnu" }
26+
- { os: linux-arm64-public, docker_platform: linux/arm64, rust_target: "aarch64-unknown-linux-gnu" }
2227
env:
2328
CS_ZEROKMS_HOST: https://us-east-1.aws.zerokms.cipherstashmanaged.net
2429
CS_CTS_HOST: https://ap-southeast-2.aws.cts.cipherstashmanaged.net
@@ -45,8 +50,8 @@ jobs:
4550
cache-all-crates: true
4651
- uses: jdx/mise-action@v2
4752
with:
48-
version: 2025.1.6 # [default: latest] mise version to install
49-
install: true # [default: true] run `mise install`
53+
version: 2026.1.6 # [default: latest] mise version to install
54+
install: false # [default: true] run `mise install`
5055
cache: ${{ github.event_name != 'pull_request' }} # cache mise using GitHub's cache if running in a PR
5156
- run: |
5257
mise run build --platform ${{matrix.build.docker_platform}} --target ${{matrix.build.rust_target}}
@@ -107,6 +112,8 @@ jobs:
107112
timeout-minutes: 30
108113
needs:
109114
- build
115+
env:
116+
publish: ${{contains(fromJSON('["push", "release"]'), github.event_name)}}
110117
steps:
111118
- uses: actions/checkout@v4
112119

@@ -151,15 +158,19 @@ jobs:
151158
152159
- name: Create manifest list and push
153160
working-directory: ${{ runner.temp }}/digests
161+
env:
162+
DRY_RUN: ${{case(fromJSON(env.publish),' ','--dry-run')}} # run the `docker buildx` command with --dry-run if we're not publishing a release
154163
run: |
155-
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
164+
docker buildx imagetools create ${{ env.DRY_RUN }} $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
156165
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
157166
158167
- name: Inspect image
168+
if: ${{ fromJSON(env.publish) }}
159169
run: |
160170
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
161171
162172
- name: Notify Multitudes
173+
if: ${{ fromJSON(env.publish) }}
163174
run: |
164175
curl --request POST \
165176
--fail-with-body \

mise.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ CS_EQL_VERSION = "eql-2.2.1"
3838

3939

4040
[tools]
41-
"cargo:cargo-binstall" = "latest"
41+
"cargo:cargo-binstall" = "1.17.3"
4242
"cargo:cargo-nextest" = "latest"
4343
"cargo:cargo-sort" = "latest"
4444

0 commit comments

Comments
 (0)