From fe8faea08ffb0b99a2f863dc3eae3c194b2f02db Mon Sep 17 00:00:00 2001 From: OrzMiku Date: Mon, 18 Nov 2024 17:38:51 +0800 Subject: [PATCH] feat: Add GitHub Actions workflow for exporting modpack --- .github/workflows/export.yml | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/export.yml diff --git a/.github/workflows/export.yml b/.github/workflows/export.yml new file mode 100644 index 0000000..40a9ed4 --- /dev/null +++ b/.github/workflows/export.yml @@ -0,0 +1,41 @@ +name: Export Modpack +on: + push: + branches: [ "main" ] + workflow_dispatch: + inputs: + reason: + description: 'Reason for manual export' + required: false + default: 'Manual modpack export' +jobs: + export-modpack: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.19' + + - name: Install Packwiz + run: go install github.com/packwiz/packwiz@latest + + - name: Add Go bin to PATH + run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + + - name: Export Modrinth Modpack + run: | + cd versions/fabric/1.21.1 + packwiz modrinth export + echo "MODPACK_NAME=$(ls *.mrpack | sed 's/.mrpack$//')" >> $GITHUB_ENV + + - name: Upload Modrinth Modpack + uses: actions/upload-artifact@v3 + with: + name: ${{ env.MODPACK_NAME }} + path: versions/fabric/1.21.1/${{ env.MODPACK_NAME }}.mrpack + retention-days: 7 \ No newline at end of file