chore: Release loglux version 1.0.1 #6
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[0-9]+.[0-9]+.[0-9]+" | |
permissions: | |
contents: write | |
jobs: | |
create-release: | |
name: create-release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.CI_TOKEN }} | |
- name: Fetch tags | |
run: git fetch --prune --unshallow --tags --force | |
- name: Get the release version from the tag | |
if: env.VERSION == '' | |
run: echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV | |
- name: Show the version | |
run: | | |
echo "version is: $VERSION" | |
- name: Check that tag version and Cargo.toml version are the same | |
shell: bash | |
run: | | |
cargo_version="$(echo $VERSION | sed 's/^v//')" | |
if ! grep -q "version = \"$cargo_version\"" Cargo.toml; then | |
echo "version does not match Cargo.toml" >&2 | |
exit 1 | |
fi | |
- name: Generate a changelog | |
uses: orhun/git-cliff-action@v4 | |
id: git-cliff | |
with: | |
config: cliff.toml | |
args: --latest --strip all | |
env: | |
REPO_PREFIX: ${{ github.server_url }}/${{ github.repository }}/ | |
- name: Create GitHub release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release create $VERSION --draft --verify-tag --title $VERSION --notes "${{ steps.git-cliff.outputs.content }}" | |
- name: Push to CI branch | |
env: | |
GITHUB_TOKEN: ${{ secrets.CI_TOKEN }} | |
shell: bash | |
run: | | |
git branch -D ci-temp || true | |
git checkout -b ci-temp | |
git push -u origin ci-temp:ci --force |