summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build-modpack.yml26
-rw-r--r--.github/workflows/update-checksums.yml33
-rw-r--r--.github/workflows/update-mods.yml38
3 files changed, 76 insertions, 21 deletions
diff --git a/.github/workflows/build-modpack.yml b/.github/workflows/build-modpack.yml
new file mode 100644
index 0000000..aace7f9
--- /dev/null
+++ b/.github/workflows/build-modpack.yml
@@ -0,0 +1,26 @@
+name: Build modpack
+
+on:
+ push:
+ paths:
+ # only run when prismlauncher modpack files are changed
+ - nix/files/**
+ workflow_dispatch:
+
+jobs:
+ build-modpack:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+ - uses: cachix/install-nix-action@v20
+
+ - name: build
+ run: |
+ nix build
+
+ - name: upload
+ uses: actions/upload-artifact@v3
+ with:
+ name: getchoo-modpack.zip
+ path: ${{ github.workspace }}/result/*
diff --git a/.github/workflows/update-checksums.yml b/.github/workflows/update-checksums.yml
new file mode 100644
index 0000000..7a5b9a3
--- /dev/null
+++ b/.github/workflows/update-checksums.yml
@@ -0,0 +1,33 @@
+name: Update mod checksums
+
+on:
+ push:
+ paths:
+ # only run when mod files are changed
+ - mods/**
+ workflow_dispatch:
+ workflow_run:
+ workflows: ["Update mods"]
+ types:
+ - completed
+
+permissions:
+ contents: write
+
+jobs:
+ build-modpack:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+ - uses: cachix/install-nix-action@v20
+
+ - name: generate new checksums
+ run: |
+ nix run --impure .#generate-checksums
+
+ - name: commit changes
+ uses: EndBug/add-and-commit@v9
+ with:
+ default_author: github_actions
+ message: "chore(flake): update mod checksums"
diff --git a/.github/workflows/update-mods.yml b/.github/workflows/update-mods.yml
index 79f6b71..03c3df4 100644
--- a/.github/workflows/update-mods.yml
+++ b/.github/workflows/update-mods.yml
@@ -1,31 +1,27 @@
name: Update mods
+
on:
- workflow_dispatch:
schedule:
- - cron: '0 0 * * *'
+ # run daily at 0:00 utc
+ - cron: "0 0 * * *"
+ workflow_dispatch:
+
+permissions:
+ contents: write
+
jobs:
update-mods:
runs-on: ubuntu-latest
steps:
- - name: get packwiz
- run: |
- curl -fsSLo ~/packwiz.zip https://nightly.link/packwiz/packwiz/workflows/go/main/Linux%2064-bit%20x86.zip
- unzip -d ~ ~/packwiz.zip
- chmod 755 ~/packwiz
- uses: actions/[email protected]
- - name: update mods
- run: |
- echo "y" | ~/packwiz update --all
- - name: check for changes
- id: git-check
- run: |
- echo ::set-output name=modified::$(if git status --porcelain | grep -E 'pack.toml|index.toml|mods\/' > /dev/null; then echo "true"; else echo "false"; fi)
- - name: commit updates
- if: steps.git-check.outputs.modified == 'true'
+ - uses: cachix/install-nix-action@v20
+
+ - name: update
run: |
- git config --global user.name 'github-actions[bot]'
- git config --global user.email 'github-actions[bot]@users.noreply.github.com'
+ echo "y" | nix run nixpkgs#packwiz -- update --all
- git add mods/ index.toml pack.toml
- git commit -m "chore: update mods"
- git push
+ - name: commit changes
+ uses: EndBug/add-and-commit@v9
+ with:
+ default_author: github_actions
+ message: "chore: update mods"