summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-06-27 20:38:21 +0900
committerOphestra <cat@gensokyo.uk>2025-06-27 20:38:56 +0900
commit394bf00ce1cfd2d6899df568c3338509d6acd490 (patch)
tree9ad248ad2831767015cd580f9c498e84df0f60e6
parent42c21ad90626346277861471b1d6896a4e2e5058 (diff)
workflows: workflows via nix
-rw-r--r--.gitea/workflows/static.yml39
-rw-r--r--.github/dependabot.yml17
-rw-r--r--.github/workflows/static.yml25
3 files changed, 39 insertions, 42 deletions
diff --git a/.gitea/workflows/static.yml b/.gitea/workflows/static.yml
new file mode 100644
index 00000000..676262c0
--- /dev/null
+++ b/.gitea/workflows/static.yml
@@ -0,0 +1,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
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
deleted file mode 100644
index cbfbb4ba..00000000
--- a/.github/dependabot.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-version: 2
-updates:
- - package-ecosystem: github-actions
- directory: "/"
- schedule:
- interval: daily
- target-branch: main
- - package-ecosystem: npm
- directory: "/"
- schedule:
- interval: daily
- target-branch: main
- - package-ecosystem: pip
- directory: "/"
- schedule:
- interval: daily
- target-branch: main
diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml
deleted file mode 100644
index 9118e7c4..00000000
--- a/.github/workflows/static.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-name: Validate and process static files
-
-on: [pull_request, push]
-
-jobs:
- static:
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- cache: npm
- - uses: actions/setup-python@v5
- with:
- python-version: '3.12'
- cache: pip
-
- - run: sudo apt-get update
- - run: sudo apt-get -y install libxml2-utils yajl-tools moreutils zopfli
- - run: npm ci --ignore-scripts
- - run: 'pip install --require-hashes --only-binary :all: -r requirements.txt'
-
- - name: process static
- run: ./process-static