From a66ff6e9166b4ffb230ff8069860cc4a6579d5e7 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 27 Jun 2025 20:38:21 +0900 Subject: [PATCH] workflows: workflows via nix --- .gitea/workflows/static.yml | 39 ++++++++++++++++++++++++++++++++++++ .github/dependabot.yml | 17 ---------------- .github/workflows/static.yml | 25 ----------------------- 3 files changed, 39 insertions(+), 42 deletions(-) create mode 100644 .gitea/workflows/static.yml delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/static.yml 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