diff --git a/.github/workflows/AutoBuildPack.yml b/.github/workflows/AutoBuildPack.yml index af47232..53036c1 100644 --- a/.github/workflows/AutoBuildPack.yml +++ b/.github/workflows/AutoBuildPack.yml @@ -7,6 +7,11 @@ on: push: branches: [ main ] +env: + PROJECT_ID: Cc9a9YwB + RELEASE_TYPE: 22.03-SNAPSHOT + USE_TG: true + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" @@ -26,25 +31,48 @@ jobs: with: go-version: '1.19' - - name: get version - id: pack_version + - name: get info run: | echo "pack_version=$(git show -s --format=%B | head -1 | grep -o '[0-9\.]*$')" >> $GITHUB_ENV + echo "game_version=$(grep -oP '(?<=minecraft = \")[0-9.]+' ./pack.toml)" >> $GITHUB_ENV + echo "loader=$(grep -oP '(quilt|fabric|forge)' ./pack.toml)" >> $GITHUB_ENV # Runs a single command using the runners shell - name: build modpack run: bash build.sh + + - name: Create changelog text + id: changelog + uses: loopwerk/tag-changelog@v1 + with: + token: ${{ secrets.SECRET }} + exclude_types: other - name: release uses: ncipollo/release-action@v1 with: name: ${{ env.pack_version }} + body: ${{ steps.changelog.outputs.changes }} allowUpdates: true tag: ${{ env.pack_version }} commit: main replacesArtifacts: true token: ${{ secrets.SECRET }} artifacts: ./*.mrpack + + - name: Upload to Modrinth + uses: RubixDev/modrinth-upload@v1 + with: + token: ${{ secrets.MODRINTH }} + file_path: ./*.mrpack + name: ${{ env.pack_version }} + version: ${{ env.pack_version }} + changelog: ${{ steps.changelog.outputs.changes }} + game_versions: ${{ env.game_version }} + release_type: ${{ env.RELEASE_TYPE }} + loaders: ${{ env.loader }} + featured: false + project_id: ${{ env.PROJECT_ID }} preRelease: runs-on: ubuntu-latest