Publish Release #5
Workflow file for this run
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 Release | |
on: | |
workflow_dispatch: | |
inputs: | |
patch: | |
description: "Patch version" | |
required: true | |
type: string | |
release-type: | |
description: "Release Type" | |
required: true | |
type: choice | |
options: | |
- release | |
- alpha | |
- beta | |
- pre | |
- rc | |
default: release | |
build: | |
description: "Build" | |
required: true | |
type: string | |
default: "0" | |
jobs: | |
publish-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.TEAM_RESOURCEFUL_BOT }} | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Cache Gradle packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: Set Gradle Perms | |
run: chmod +x gradlew | |
- name: Update Mod Version | |
run: ./gradlew updateModVersion --patch=${{ inputs.patch }} --releaseType=${{ inputs.release-type }} --build=${{ inputs.build }} | |
- name: Get Mod Version | |
id: version | |
uses: christian-draeger/[email protected] | |
with: | |
path: "./version.properties" | |
properties: "version" | |
- name: Get MC Version and Platforms | |
id: props | |
uses: christian-draeger/[email protected] | |
with: | |
path: "./gradle.properties" | |
properties: "minecraftVersion enabledPlatforms" | |
- name: Publish package | |
run: ./gradlew build --info | |
env: | |
MAVEN_USER: ${{ secrets.MAVEN_USERNAME }} | |
MAVEN_PASS: ${{ secrets.MAVEN_PASSWORD }} | |
# - name: Update Changelog | |
# uses: Team-Resourceful/[email protected] | |
# with: | |
# release_version: ${{ steps.version.outputs.version }} | |
# github_token: ${{ secrets.TEAM_RESOURCEFUL_BOT }} | |
### Need to duplicate this block for fabric | |
- name: Upload Forge Releases (Curse/Modrinth/Github) | |
if: contains(steps.props.outputs.enabledPlatforms, 'forge') | |
uses: Kir-Antipov/[email protected] | |
with: | |
curseforge-id: ${{ vars.CURSE_ID }} | |
curseforge-token: ${{ secrets.CURSE_API_KEY }} | |
modrinth-id: ${{ vars.MODRINTH_ID }} | |
modrinth-token: ${{ secrets.MODRINTH_API_KEY }} | |
github-tag: "v${{ steps.version.outputs.version }}" | |
github-token: ${{ secrets.TEAM_RESOURCEFUL_BOT }} | |
files: ./forge/build/libs/!(*-@(dev|sources|dev-shadow)).jar | |
name: "[Forge] Highlight ${{ steps.version.outputs.version }}" | |
version: ${{ steps.version.outputs.version }} | |
changelog-file: changelog.md | |
loaders: forge | |
game-versions: ${{ steps.props.outputs.minecraftVersion }} | |
version-resolver: exact | |
- name: Upload Fabric Releases (Curse/Modrinth/Github) | |
if: contains(steps.props.outputs.enabledPlatforms, 'fabric') | |
uses: Kir-Antipov/[email protected] | |
with: | |
curseforge-id: ${{ vars.CURSE_ID }} | |
curseforge-token: ${{ secrets.CURSE_API_KEY }} | |
modrinth-id: ${{ vars.MODRINTH_ID }} | |
modrinth-token: ${{ secrets.MODRINTH_API_KEY }} | |
github-tag: "v${{ steps.version.outputs.version }}" | |
github-token: ${{ secrets.TEAM_RESOURCEFUL_BOT }} | |
files: ./fabric/build/libs/!(*-@(dev|sources|dev-shadow)).jar | |
name: "[Fabric] Highlight ${{ steps.version.outputs.version }}" | |
version: ${{ steps.version.outputs.version }} | |
changelog-file: changelog.md | |
loaders: fabric | |
game-versions: ${{ steps.props.outputs.minecraftVersion }} | |
version-resolver: exact | |
- name: Create Discord Embed | |
run: ./gradlew injectDiscordEmbed | |
- name: Send Discord Webhook | |
uses: tsickert/[email protected] | |
with: | |
webhook-url: ${{ secrets.DISCORD_RELEASE_WEBHOOK }} | |
raw-data: ./build/release_embed.json | |
- name: Commit Version Updates | |
run: | | |
git config --global user.name "TeamResourcefulBot" | |
git config --global user.email "[email protected]" | |
git diff-index --quiet HEAD || { git commit -am "Released v${{ steps.version.outputs.version }}"; git push; } |