87 lines
2.6 KiB
YAML
87 lines
2.6 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: Run Checks
|
|
run: nix develop --no-pure-eval --command 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: 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
|
|
run: nix develop --no-pure-eval --command just cliff-bump
|
|
|
|
- name: Create release commit
|
|
if: steps.releasable.outputs.count > 0
|
|
run: |
|
|
VERSION=${{ steps.next_version.outputs.version }}
|
|
nix develop --no-pure-eval --command just commit-release "$VERSION"
|
|
|
|
- name: Create version tag
|
|
if: steps.releasable.outputs.count > 0
|
|
run: |
|
|
VERSION=${{ steps.next_version.outputs.version }}
|
|
nix develop --no-pure-eval --command 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
|
|
run: nix develop --no-pure-eval --accept-flake-config --command cargo publish
|
|
env:
|
|
CARGO_REGISTRIES_CRATES_IO_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
|
|
- name: Rebase develop onto main
|
|
if: steps.releasable.outputs.count > 0
|
|
run: nix develop --no-pure-eval --command just rebase-develop
|
|
|
|
- name: Bump to next dev version
|
|
if: steps.releasable.outputs.count > 0
|
|
run: |
|
|
VERSION=${{ steps.next_version.outputs.version }}
|
|
nix develop --no-pure-eval --command just update-develop-version "$VERSION"
|