Skip to content

Commit

Permalink
fix: workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
xalixilax committed Aug 4, 2024
1 parent 8c5fcea commit bc1f1ff
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 65 deletions.
66 changes: 1 addition & 65 deletions .github/workflows/packsquash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
branches:
- main
tags:
- "v*"
workflow_dispatch:

jobs:
packsquash:
Expand Down Expand Up @@ -54,65 +51,4 @@ jobs:
name: ${{ steps.info.outputs.name }} v${{ steps.info.outputs.version }}
path: src/

- name: Make Optimized Pack
if: startsWith(github.ref, 'refs/tags/v')
uses: ComunidadAylas/PackSquash-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
options: packsquash.toml
packsquash_version: latest

- name: Rename Optimized Pack
if: startsWith(github.ref, 'refs/tags/v')
run: mv ${{ steps.info.outputs.output }} "${{ steps.info.outputs.package }}.zip"

- name: Publish
if: startsWith(github.ref, 'refs/tags/v')
uses: Kir-Antipov/[email protected]
with:
modrinth-id: Srw5RQ6k
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
curseforge-id: 513425
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
files-primary: ${{ steps.info.outputs.package }}.zip
name: ${{ steps.info.outputs.name }} v${{ steps.info.outputs.version }}
version: v${{ steps.info.outputs.version }}
version-type: release
changelog-file: CHANGELOG.md
game-versions: |
1.21
1.20.6
1.20.5
1.20.4
1.20.3
1.20.2
1.20.1
1.20
1.19.3
1.19.2
1.19.1
1.19
1.18.2
1.18.1
1.18
1.17.1
1.17
1.16.5
1.16.4
1.16.3
1.16.2
1.16.1
1.16
1.15.2
1.15.1
1.15
1.14.4
1.14.3
1.14.2
1.14.1
1.14
1.13.2
1.13.1
1.13
loaders: |
minecraft

110 changes: 110 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Build optimized resource pack

on:
workflow_dispatch:

jobs:
packsquash:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3

- name: Download tombl
uses: robinraju/[email protected]
with:
repository: snyball/tombl
fileName: "*.tar.gz"
latest: true

- name: Install tombl
run: |
mkdir bin
tar -zxvf tombl-*.tar.gz -C bin/
readonly tombl=$(find bin/ -type f -executable -print -quit)
echo "$(dirname $tombl)" >> $GITHUB_PATH
- name: Prepare environments
id: info
run: |
eval "$(tombl -e name=name pack.toml)"
echo "name=$name" >> $GITHUB_OUTPUT
eval "$(tombl -e version=version pack.toml)"
echo "version=$version" >> $GITHUB_OUTPUT
sha=`echo $GITHUB_SHA | cut -c 1-7`
echo "sha=$sha" >> $GITHUB_OUTPUT
package=${name}-${version}-rev.${sha}
echo "package=$package" >> $GITHUB_OUTPUT
mkdir build
eval "$(tombl -e output=output_file_path packsquash.toml)"
echo "output=$output" >> $GITHUB_OUTPUT
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.info.outputs.name }} v${{ steps.info.outputs.version }}
path: src/

- name: Make Optimized Pack
uses: ComunidadAylas/PackSquash-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
options: packsquash.toml
packsquash_version: latest

- name: Rename Optimized Pack
run: mv ${{ steps.info.outputs.output }} "${{ steps.info.outputs.package }}.zip"

- name: Publish
uses: Kir-Antipov/[email protected]
with:
modrinth-id: Srw5RQ6k
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
curseforge-id: 513425
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
files-primary: ${{ steps.info.outputs.package }}.zip
name: ${{ steps.info.outputs.name }} v${{ steps.info.outputs.version }}
version: v${{ steps.info.outputs.version }}
version-type: release
changelog-file: CHANGELOG.md
game-versions: |
1.21
1.20.6
1.20.5
1.20.4
1.20.3
1.20.2
1.20.1
1.20
1.19.3
1.19.2
1.19.1
1.19
1.18.2
1.18.1
1.18
1.17.1
1.17
1.16.5
1.16.4
1.16.3
1.16.2
1.16.1
1.16
1.15.2
1.15.1
1.15
1.14.4
1.14.3
1.14.2
1.14.1
1.14
1.13.2
1.13.1
1.13
loaders: |
minecraft

0 comments on commit bc1f1ff

Please sign in to comment.