Auto Publish, Releasing #126
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
name: Auto Publish, Releasing | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseType: | |
description: 'release type' | |
required: true | |
type: choice | |
default: 'beta' | |
options: | |
- 'release' | |
- 'beta' | |
- 'alpha' | |
publishMaven: | |
description: 'whether publish to the maven' | |
required: true | |
type: boolean | |
default: true | |
publishCurseForgeAndModrinth: | |
description: 'whether to publish to curseforge and modrinth' | |
required: true | |
type: boolean | |
default: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
MAVEN_PASS: ${{ secrets.MAVEN_PASS }} | |
MAVEN_USER: ${{ secrets.MAVEN_USER }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup Build | |
uses: ./.github/actions/build_setup | |
- name: Build | |
run: ./gradlew build --build-cache | |
- if: ${{ inputs.publishMaven }} | |
name: Publish to Maven | |
run: ./gradlew publish --build-cache | |
- if: ${{ inputs.publishCurseForgeAndModrinth }} | |
name: Get Version | |
id: var | |
run: | | |
MESSAGE=$(ls build/libs/* | grep sources.jar -v | grep shadow.jar -v | grep slim.jar -v | awk -F 'gtceu-|.jar' '{print $2}') | |
echo version=$MESSAGE >> $GITHUB_OUTPUT | |
- if: ${{ inputs.publishCurseForgeAndModrinth }} | |
name: mc-publish-forge | |
uses: Kir-Antipov/mc-publish@v3.3.0 | |
with: | |
# Only include this section if you wish to publish | |
# your assets on Modrinth. | |
modrinth-id: 7tG215v7 | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
# Only include this section if you wish to publish | |
# your assets on CurseForge. | |
curseforge-id: 890405 | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
files: | | |
build/libs/!(*-@(dev|sources|javadoc|dev-shadow|slim)).jar | |
build/libs/*-@(dev|sources|javadoc|dev-shadow|slim).jar | |
name: GregTechCEu ${{ steps.var.outputs.version }} | |
version: mc${{ steps.var.outputs.version }} | |
version-type: ${{ inputs.releaseType }} | |
changelog-file: CHANGELOG.* | |
loaders: | | |
neoforge | |
game-versions: | | |
${{ github.ref_name }} | |
game-version-filter: none | |
java: | | |
21 | |
retry-attempts: 2 | |
retry-delay: 10000 | |
fail-mode: fail |