Merge pull request #108 from flavio/new-release #25
Workflow file for this run
This file contains 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*' | |
env: | |
CARGO_TERM_COLOR: always | |
# This is required because commands like `cargo check` do not | |
# read the cargo development dependencies. | |
# See https://github.com/Arnavion/k8s-openapi/issues/132 | |
K8S_OPENAPI_ENABLED_VERSION: "1.26" | |
jobs: | |
ci: | |
# A branch is required, and cannot be dynamic - https://github.com/actions/runner/issues/1493 | |
uses: kubewarden/policy-sdk-rust/.github/workflows/tests.yml@main | |
release: | |
name: Create release | |
runs-on: ubuntu-latest | |
needs: | |
- ci | |
steps: | |
- name: Create Release | |
id: create-release | |
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Kubewarden Rust SDK ${{ github.ref }} | |
draft: false | |
prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') || contains(github.ref, '-rc') }} | |
publish: | |
name: Publish on crates.io | |
runs-on: ubuntu-latest | |
needs: | |
- ci | |
steps: | |
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 | |
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: publish crates | |
run: cargo publish --token ${{ secrets.CARGO_API_TOKEN }} |