Publish on GitHub Releases, CurseForge and Modrinth #1
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: Publish on GitHub Releases, CurseForge and Modrinth | |
on: [pull_request, workflow_dispatch] | |
env: | |
MINECRAFT_VERSION: 1.21.1 | |
JAVA_VERSION: 21 | |
VERSION: 5.0.0+1.21.1 | |
RELEASE_NAME: Additional Bars 5.0.0 | |
GITHUB_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }} | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check Environment Variables | |
run: env | |
- name: Check-out Repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Setup Java | |
uses: actions/setup-java@v2 | |
with: | |
distribution: "temurin" | |
java-version: ${{env.JAVA_VERSION}} | |
- name: Make Gradle Wrapper Executable | |
if: ${{ runner.os != 'Windows' }} | |
run: chmod +x ./gradlew | |
- name: Build | |
run: ./gradlew clean build | |
- name: Publish to GitHub | |
uses: Kir-Antipov/mc-publish@v3.3 | |
with: | |
github-tag: "v${{env.VERSION}}" | |
github-token: "${{env.GITHUB_TOKEN}}" | |
name: "${{env.RELEASE_NAME}}" | |
version: "${{env.VERSION}}" | |
version-type: release | |
changelog-file: CHANGELOG.md | |
loaders: neoforge | |
game-versions: "${{env.MINECRAFT_VERSION}}" | |
java: "${{env.JAVA_VERSION}}" |