workflows: workflows via nix

This commit is contained in:
Ophestra 2025-06-27 20:38:21 +09:00
parent 42c21ad906
commit a66ff6e916
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q
3 changed files with 39 additions and 42 deletions

View File

@ -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

View File

@ -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

View File

@ -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