mirror of
https://github.com/imjasonh/krust
synced 2026-07-08 06:45:32 +00:00
add release workflow
Signed-off-by: Jason Hall <jason@chainguard.dev>
This commit is contained in:
parent
bba26792f8
commit
a4603c99e5
2 changed files with 50 additions and 1 deletions
49
.github/workflows/release.yaml
vendored
Normal file
49
.github/workflows/release.yaml
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
name: Publish to crates.io
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
id-token: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||||
|
- uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921 # master
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
|
||||||
|
- name: Cache cargo registry
|
||||||
|
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
|
||||||
|
with:
|
||||||
|
path: ~/.cargo/registry
|
||||||
|
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
|
- name: Cache cargo index
|
||||||
|
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
|
||||||
|
with:
|
||||||
|
path: ~/.cargo/git
|
||||||
|
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
|
- name: Verify version matches tag
|
||||||
|
run: |
|
||||||
|
CARGO_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
|
||||||
|
TAG_VERSION=${GITHUB_REF#refs/tags/v}
|
||||||
|
if [ "$CARGO_VERSION" != "$TAG_VERSION" ]; then
|
||||||
|
echo "Version mismatch: Cargo.toml has $CARGO_VERSION, but tag is $TAG_VERSION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- run: cargo test --verbose
|
||||||
|
|
||||||
|
- uses: rust-lang/crates-io-auth-action@041cce5b4b821e6b0ebc9c9c38b58cac4e34dcc2 # v1.0.2
|
||||||
|
id: auth
|
||||||
|
- run: cargo publish
|
||||||
|
env:
|
||||||
|
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "krust"
|
name = "krust"
|
||||||
version = "0.1.0"
|
version = "0.0.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Jason Hall <imjasonh@gmail.com>"]
|
authors = ["Jason Hall <imjasonh@gmail.com>"]
|
||||||
description = "A container image build tool for Rust applications"
|
description = "A container image build tool for Rust applications"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue