fixing modifiers list #10
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: Release | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v20.15.10 | |
- "v[0-9]+.[0-9]+.[0-9]+.?[0-9]*" # Push events to matching v*, v20.15.10.1 | |
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+" # Push events to matching alpha releases | |
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+" # Push events to matching beta releases | |
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+" # Push events to matching release candidates | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Get the version | |
id: get_version | |
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/} | |
- name: Declare Commit Variables | |
id: is_pre_release | |
shell: bash | |
run: | | |
echo "::set-output name=IS_PRE_RELEASE::$(echo "${{ steps.get_version.outputs.VERSION }}" | awk 'BEGIN{prerelease="false"} /beta|alpha/{prerelease="true"} END{print prerelease}')" | |
- name: Set Release Type | |
id: release_type | |
shell: bash | |
run: | | |
echo "::set-output name=RELEASE_TYPE::$(echo "${{ steps.get_version.outputs.VERSION }}" | awk 'BEGIN{release_type="release"} /beta|alpha/{release_type="alpha"} END{print release_type}')" | |
- name: Set File Name | |
id: file_name | |
shell: bash | |
run: | | |
echo "::set-output name=FILE_NAME::$(echo randomloot-$(echo "${{ steps.get_version.outputs.VERSION }}" | grep -o '[0-9]*\.[0-9]*\.[0-9]*').jar)" | |
- name: Build with Gradle | |
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 | |
with: | |
arguments: build | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
prerelease: ${{ steps.is_pre_release.outputs.IS_PRE_RELEASE }} | |
files: "build/libs/*.jar" | |
- name: Upload to CurseForge | |
uses: itsmeow/[email protected] | |
with: | |
file_path: "build/libs/${{ steps.file_name.outputs.FILE_NAME }}" | |
game_endpoint: "minecraft" | |
game_versions: "Minecraft 1.20:1.20.1,Java 17,Forge" | |
token: "${{ secrets.CurseForge }}" | |
project_id: "301631" | |
display_name: "Random Loot 2 - ${{ steps.get_version.outputs.VERSION }}" | |
release_type: ${{ steps.release_type.outputs.RELEASE_TYPE }} |