fix: update Cargo.lock for v2.0.0 #18
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo test --all | |
| - name: Publish to crates.io | |
| run: | | |
| cargo publish 2>&1 || { | |
| if cargo search initium --limit 1 | grep -q "$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')"; then | |
| echo "::warning::Version already published to crates.io — skipping" | |
| else | |
| echo "::error::cargo publish failed" | |
| exit 1 | |
| fi | |
| } | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| - uses: sigstore/cosign-installer@v3 | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract version | |
| id: version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT" | |
| - uses: docker/build-push-action@v6 | |
| id: build-main | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| build-args: | | |
| VERSION=${{ steps.version.outputs.VERSION }} | |
| tags: | | |
| ghcr.io/kitstream/initium:${{ steps.version.outputs.VERSION }} | |
| ghcr.io/kitstream/initium:latest | |
| cache-from: type=gha,scope=docker-main | |
| cache-to: type=gha,mode=max,scope=docker-main | |
| sbom: true | |
| provenance: true | |
| - name: Sign initium image | |
| run: cosign sign --yes ghcr.io/kitstream/initium@${{ steps.build-main.outputs.digest }} | |
| - name: SBOM attestation for initium image | |
| run: | | |
| cosign attest --yes --type spdx \ | |
| --predicate <(docker buildx imagetools inspect ghcr.io/kitstream/initium@${{ steps.build-main.outputs.digest }} --format '{{json .SBOM.SPDX}}') \ | |
| ghcr.io/kitstream/initium@${{ steps.build-main.outputs.digest }} | |
| - uses: docker/build-push-action@v6 | |
| id: build-jyq | |
| with: | |
| context: . | |
| file: Dockerfile.jyq | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| build-args: | | |
| VERSION=${{ steps.version.outputs.VERSION }} | |
| tags: | | |
| ghcr.io/kitstream/initium-jyq:${{ steps.version.outputs.VERSION }} | |
| ghcr.io/kitstream/initium-jyq:latest | |
| cache-from: type=gha,scope=docker-jyq | |
| cache-to: type=gha,mode=max,scope=docker-jyq | |
| sbom: true | |
| provenance: true | |
| - name: Sign initium-jyq image | |
| run: cosign sign --yes ghcr.io/kitstream/initium-jyq@${{ steps.build-jyq.outputs.digest }} | |
| - name: SBOM attestation for initium-jyq image | |
| run: | | |
| cosign attest --yes --type spdx \ | |
| --predicate <(docker buildx imagetools inspect ghcr.io/kitstream/initium-jyq@${{ steps.build-jyq.outputs.digest }} --format '{{json .SBOM.SPDX}}') \ | |
| ghcr.io/kitstream/initium-jyq@${{ steps.build-jyq.outputs.digest }} |