Files
jj-cz/.github/workflows/release.yml
Lucien Cartier-Tilet 7603e331bd
All checks were successful
Release / release (push) Successful in 11m59s
Release / checks (push) Successful in 8m35s
Publish Docker Images / coverage-and-sonar (push) Successful in 24m33s
chore(release): prepare 1.0.0 release
2026-03-25 15:46:11 +01:00

107 lines
3.3 KiB
YAML

name: Release
on:
push:
branches:
- main
jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Set up cachix
uses: cachix/cachix-action@v17
with:
name: phundrak
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Run Checks
shell: bash -c "nix develop --no-pure-eval --accept-flake-config --command {0}"
run: just check-all
release:
needs: checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.CI_TOKEN }}
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Set up cachix
uses: cachix/cachix-action@v17
with:
name: phundrak
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Check for releasable commits
id: releasable
run: |
COUNT=$(nix develop --no-pure-eval --command just cliff-count)
echo "count=$COUNT" >> $GITHUB_OUTPUT
- name: Determine next version
if: steps.releasable.outputs.count > 0
id: next_version
run: |
CLIFF_NEXT_VERSION=$(nix develop --no-pure-eval --command just cliff-next-version)
echo "version=$CLIFF_NEXT_VERSION" >> $GITHUB_OUTPUT
- name: Update changelog
if: steps.releasable.outputs.count > 0
shell: bash -c "nix develop --no-pure-eval --accept-flake-config --command {0}"
run: just cliff-bump
- name: Create release commit
if: steps.releasable.outputs.count > 0
env:
VERSION: ${{ steps.next_version.outputs.version }}
shell: bash -c "nix develop --no-pure-eval --accept-flake-config --command {0}"
run: just commit-release $VERSION
- name: Create version tag
if: steps.releasable.outputs.count > 0
env:
VERSION: ${{ steps.next_version.outputs.version }}
shell: bash -c "nix develop --no-pure-eval --accept-flake-config --command {0}"
run: just create-release-tag $VERSION
- name: Build Linux release binaries
if: steps.releasable.outputs.count > 0
run: nix build
- name: Build Windows release binaries
if: steps.releasable.outputs.count > 0
run: nix build .#windows
- name: Publish on crates.io
if: steps.releasable.outputs.count > 0
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
shell: bash -c "nix develop --no-pure-eval --accept-flake-config --command {0}"
run: cargo publish
- name: Rebase develop onto main
if: steps.releasable.outputs.count > 0
shell: bash -c "nix develop --no-pure-eval --accept-flake-config --command {0}"
run: just rebase-develop
- name: Bump to next dev version
if: steps.releasable.outputs.count > 0
env:
VERSION: ${{ steps.next_version.outputs.version }}
shell: bash -c "nix develop --no-pure-eval --accept-flake-config --command {0}"
run: just update-develop-version $VERSION