summaryrefslogtreecommitdiff
path: root/.gitea/workflows/static.yml
blob: 676262c04d4cb426ae8873af1d3af6aaf6948f68 (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
name: Static

on:
  - push
  - pull_request

jobs:
  check:
    name: Flake checks
    runs-on: nix
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Run checks
        run: nix --print-build-logs --experimental-features 'nix-command flakes' flake check

  dist:
    name: Create distribution
    runs-on: nix
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Process static files
        id: static-test
        run: >-
          export HAKUREI_REV="$(git rev-parse --short HEAD)" &&
          sed -i.old 's/version = /version = "0.0.0-'$HAKUREI_REV'"; # version = /' package.nix &&
          nix build --print-out-paths --print-build-logs .#hakurei-static &&
          mv package.nix.old package.nix &&
          echo "rev=$HAKUREI_REV" >> $GITHUB_OUTPUT

      - name: Upload static files
        uses: actions/upload-artifact@v3
        with:
          name: "hakurei.app-${{ steps.static-test.outputs.rev }}"
          path: result/*
          retention-days: 1