Skip to content

Release

Release #14

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
release-level:
type: choice
description: 'Release Level'
options:
- release
- patch
- minor
- major
- rc
- beta
- alpha
publish:
type: boolean
description: 'Publish to crates.io?'
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: 📂 Checkout code
uses: actions/checkout@v4
- name: 🧑‍💻 Set up git user
uses: fregante/setup-git-user@v2
- name: 🚧 Install cargo-release
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-release
- name: 📦 Package
run: cargo release --no-confirm --execute --no-publish ${{ github.event.inputs.release-level }}
env:
CRATE_NAME: netlink-tc
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: 🏷️ Tag
run: cargo release tag --no-confirm --execute
- name: 📤 Push
run: git push --follow-tags
- name: 🚀 Release
run: gh release create "$(git describe --tags)" --title "$(git describe --tags)" --generate-notes
env:
GH_TOKEN: ${{ github.token }}
publish:
name: Publish
runs-on: ubuntu-latest
if: github.event.inputs.publish == 'true'
steps:
- name: 📂 Checkout code
uses: actions/checkout@v4
- name: 🧑‍💻 Set up git user
uses: fregante/setup-git-user@v2
- name: 🚧 Install cargo-release
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-release
- name: 📦 Publish
run: cargo release --no-confirm --execute ${{ github.event.inputs.release-level }}
env:
CRATE_NAME: netlink-tc
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}