build: add auto release
Some checks failed
check-flake / build (push) Successful in 2m27s
check-flake / release (push) Failing after 10s

This commit is contained in:
2024-11-14 20:09:01 +02:00
parent aef12de964
commit 562db427c6

View File

@@ -0,0 +1,52 @@
name: check-flake
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: "main"
- name: Setup sudo (required for the next step)
run: apt-get update && apt-get install -y sudo
- name: Setup nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
experimental-features = nix-command flakes
github_access_token: ${{ secrets.GH_ACCESS_TOKEN }}
nix_path: nixpkgs=channel:nixos-24.05
- uses: cachix/cachix-action@v15
with:
name: palkx
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: nix-community
- name: Build nix flake
run: |
while true; do sleep 1; rm -rf /homeless-shelter; done &
nix build
- name: Check nix flake
run: nix flake check --all-systems
release:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Semver release
uses: cocogitto/cocogitto-action@v3
id: release
with:
release: true
git-user: "Cog Bot"
git-user-email: "mycoolproject@org.org"
# The version number is accessible as a github action output
- name: Print version
run: "echo '${{ steps.release.outputs.version }}'"