-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup a GitHub actions publish workflow
- Loading branch information
1 parent
1064ed9
commit f6fea4e
Showing
4 changed files
with
118 additions
and
3 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,99 @@ | ||
name: Publish on GitHub, Curseforge and Modrinth | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
version: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version_number: "${{ steps.version_number.outputs.result }}" | ||
version_type: "${{ steps.version_type.outputs.result }}" | ||
steps: | ||
- name: Get Version | ||
id: version_number | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
result-encoding: string | ||
script: | | ||
let ref = '${{ github.ref }}'; | ||
return ref.startsWith('refs/tags/v') ? ref.replace('refs/tags/v', '') : 'indev'; | ||
- name: Get Version Type | ||
id: version_type | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
result-encoding: string | ||
script: | | ||
let version = '${{ steps.version.outputs.result }}'; | ||
return version.includes('alpha') ? 'alpha' : (version.includes('beta') ? 'beta' : 'release'); | ||
main: | ||
needs: [ version ] | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
permissions: | ||
contents: write | ||
packages: write | ||
env: | ||
VERSION: ${{ needs.version.outputs.version_number }} | ||
VERSION_TYPE: ${{ needs.version.outputs.version_type }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v4 | ||
|
||
- name: Make Gradle Wrapper Executable | ||
if: ${{ runner.os != 'Windows' }} | ||
run: chmod +x ./gradlew | ||
|
||
- name: Log Version Info | ||
run: echo "version = $VERSION, type = $VERSION_TYPE" | ||
|
||
- name: Build | ||
run: ./gradlew build | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish (CurseForge/Modrinth/GitHub) | ||
uses: Kir-Antipov/[email protected] | ||
with: | ||
# TODO update this after ensuring CI produces a working jar | ||
# modrinth-id: PhnM3Lkv | ||
# modrinth-token: ${{ secrets.MODRINTH_API_KEY }} | ||
# | ||
# curseforge-id: 695822 | ||
# curseforge-token: ${{ secrets.CURSEFORGE_API_KEY }} | ||
|
||
github-tag: ${{ github.ref }} | ||
github-draft: true | ||
github-prerelease: false | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
name: "Sacks 'N Such-1.20.1-${{ env.VERSION }}" | ||
version: "${{ env.VERSION }}" | ||
version-type: "${{ env.VERSION_TYPE }}" | ||
|
||
files: | | ||
build/libs/!(*-@(dev|sources|javadoc))-all.jar | ||
loaders: | | ||
forge | ||
neoforge | ||
game-versions: "1.20.1" | ||
java: 17 | ||
changelog-file: CHANGELOG.md |
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,8 @@ | ||
### Bug fixes | ||
|
||
- Fix duplication bug when picking up items which entirely refill all partial slots with at least one left over | ||
|
||
### Changes | ||
|
||
- Added new tag 'allowed_in_ore_sack' for items which can go into ore sacks (wow crazy) | ||
- Not ugly Icon courtesy of Aleki |
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
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