diff --git a/.gitea/workflows/test-and-build.yml b/.gitea/workflows/test-and-build.yml index d5e0557..d18b2c7 100644 --- a/.gitea/workflows/test-and-build.yml +++ b/.gitea/workflows/test-and-build.yml @@ -1,13 +1,9 @@ -name: Test and Build +name: Test, Build, and Release on: push: branches: - main - pull_request: - types: - - opened - - synchronize jobs: test: @@ -19,6 +15,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Set up cache for Cabal uses: actions/cache@v4 @@ -59,18 +57,9 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - - - name: Set up cache for Cabal - uses: actions/cache@v4 with: - path: | - ~/.cache/cabal - ~/.config/cabal - ~/.local/state/cabal - key: cabal-${{ hashFiles('tricu.cabal') }} - restore-keys: | - cabal- - + fetch-depth: 0 + - name: Set up cache for Nix uses: actions/cache@v4 with: @@ -80,9 +69,18 @@ jobs: key: nix-${{ hashFiles('flake.lock') }} restore-keys: | nix- - + - name: Build binary run: | nix build ls -alh ./result/bin/tricu - + + - name: Release binary + uses: https://gitea.com/actions/release-action@main + with: + files: |- + ./result/bin/tricu + api_key: '${{ secrets.RELEASE_TOKEN }}' + tag: $(git rev-parse --short HEAD) + title: "Release $(git rev-parse --short HEAD)" + note: "Automated release for commit $(git rev-parse --short HEAD)"