Update user_variables.db #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build with packwiz | |
on: | |
workflow_dispatch: | |
inputs: | |
artifacts: | |
description: Upload artifacts | |
required: true | |
default: "true" | |
serverpack: | |
description: Create serverpack | |
required: true | |
default: "true" | |
publish: | |
description: Publish version to CurseForge | |
required: false | |
default: "false" | |
pull_request: | |
branches: ["main", "Astral-Experimental"] | |
push: | |
branches: ["main", "Astral-Experimental"] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: setup jdk 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: "temurin" | |
- name: Get latest packwiz binary | |
id: download-packwiz | |
uses: dawidd6/action-download-artifact@v6 | |
with: | |
workflow: go.yml | |
branch: main | |
name: Linux 64-bit x86 | |
repo: packwiz/packwiz | |
- name: Make packwiz binary executable | |
run: chmod +x ./packwiz | |
- name: Restore cached mod downloads | |
id: cache-mods-restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: /home/runner/.cache/packwiz/cache | |
key: cached-mods | |
restore-keys: | | |
cached-mods- | |
- name: Construct version string | |
id: construct-base-name | |
run: | | |
echo "ASTRAL_BASE_NAME=create_astral-${{github.run_number}}" >> "$GITHUB_OUTPUT" | |
- name: Create CurseForge client zip | |
run: | | |
./packwiz curseforge export -o ${{steps.construct-base-name.outputs.ASTRAL_BASE_NAME}}-client.zip | |
- name: Prepare for serverpack creation | |
if: ${{ github.event.inputs.serverpack }} | |
run: | | |
cat server.packwizignore >> .packwizignore | |
mv serverpack/* ./ | |
./packwiz refresh | |
mkdir server | |
- name: Download packwiz-installer-bootstrap | |
if: ${{ github.event.inputs.serverpack }} | |
uses: robinraju/[email protected] | |
with: | |
repository: packwiz/packwiz-installer-bootstrap | |
latest: true | |
fileName: packwiz-installer-bootstrap.jar | |
- name: Create serverpack | |
if: ${{ github.event.inputs.serverpack }} | |
run: | | |
cd server | |
java -jar ../packwiz-installer-bootstrap.jar -g -s server ../pack.toml | |
rm -f packwiz-installer.jar | |
ls -l | |
cd ../ | |
- name: Cache mod downloads | |
id: cache-mods-save | |
uses: actions/cache/save@v4 | |
with: | |
path: | | |
/home/runner/.cache/packwiz/cache | |
./server/mods | |
key: cached-mods-${{ hashFiles('/home/runner/.cache/packwiz/cache/**/*') }}-${{ hashFiles('./server/mods') }} | |
# Otherwise the artifact would be a zip in a zip, which can't be automatically installed in launchers | |
- name: Unpack client pack for nicer artifact | |
if: ${{github.event.inputs.artifacts}} | |
run: | | |
unzip ${{steps.construct-base-name.outputs.ASTRAL_BASE_NAME}}-client.zip -d ./client | |
- name: Upload client pack to GitHub | |
if: ${{ github.event.inputs.artifacts }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{steps.construct-base-name.outputs.ASTRAL_BASE_NAME}}-client | |
path: ./client | |
- name: Upload serverpack to GitHub | |
if: ${{ github.event.inputs.serverpack && github.event.inputs.artifacts }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{steps.construct-base-name.outputs.ASTRAL_BASE_NAME}}-server | |
path: ./server | |
# This job publishes the modpack to CurseForge | |
publish: | |
runs-on: ubuntu-latest | |
needs: build | |
if: ${{github.event.inputs.publish}} | |
steps: | |
- name: Prepare files | |
uses: actions/download-artifact@v4 | |
- name: List files | |
run: ls -l |