aboutsummaryrefslogtreecommitdiffhomepage
path: root/.gitea/workflows/release.yml
blob: e032e64ccaad79fda858f372365fed553be62142 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Release

on:
  push:
    tags:
      - 'v*'

jobs:
  release:
    name: Create release
    runs-on: ubuntu-latest
    permissions:
      actions: write
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Install Nix
        uses: cachix/install-nix-action@v30
        with:
          # explicitly enable sandbox
          install_options: --daemon
          extra_nix_config: |
            sandbox = true
            system-features = nixos-test benchmark big-parallel kvm
          enable_kvm: true

      - name: Ensure environment
        run: >-
          apt-get update && apt-get install -y sqlite3
        if: ${{ runner.os == 'Linux' }}

      - name: Restore Nix store
        uses: nix-community/cache-nix-action@v5
        with:
          primary-key: build-dist-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
          restore-prefixes-first-match: build-dist-${{ runner.os }}-

      - name: Build for release
        run: nix build --print-out-paths --print-build-logs .#dist

      - name: Release
        uses: https://gitea.com/actions/release-action@main
        with:
          files: |-
            result/fortify-**
          api_key: '${{secrets.RELEASE_TOKEN}}'