-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from OrzMiku/github_workflow
feat: Add GitHub Actions workflow for exporting modpack
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |