Skip to content

Publish Release

Publish Release #8

Workflow file for this run

name: Publish Release
on:
push:
tags:
- v*
workflow_dispatch:
permissions:
contents: read
jobs:
publish-release:
environment: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check Tag
id: check-tag
run: |
if [[ ${{ github.event_name }} = workflow_dispatch ]]; then
echo ::set-output name=match::true
elif [[ ${{ github.event.ref }} =~ refs\/tags\/v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)-(0|[1-9]\d*)\.(0|[1-9]\d*) ]]; then
echo ::set-output name=match::true
fi
- name: Set up JDK 17
uses: actions/setup-java@v3
if: steps.check-tag.outputs.match == 'true'
with:
java-version: '17'
distribution: 'adopt'
cache: 'gradle'
- name: Publish
uses: gradle/gradle-build-action@v2.4.2
if: steps.check-tag.outputs.match == 'true'
with:
arguments: build publish curseforge modrinth -PMAVEN_URL=${{ secrets.MAVEN_URL }} -PMAVEN_USER=${{ secrets.MAVEN_USER }} -PMAVEN_TOKEN=${{ secrets.MAVEN_TOKEN }} -PCURSEFORGE_API=${{ secrets.CURSEFORGE_API }} -PMODRINTH_API=${{ secrets.MODRINTH_API }} -Prelease