fix publishing #107
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 tagged build | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set release version | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'adopt' | |
cache: gradle | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Setup the workspace | |
run: ./gradlew setupCIWorkspace | |
- name: Build and publish to Maven, Modrinth, and CurseForge | |
run: ./gradlew build publish | |
env: | |
MAVEN_DEPLOY_USER: ${{ secrets.MAVEN_DEPLOY_USER }} | |
MAVEN_DEPLOY_PASSWORD: ${{ secrets.MAVEN_DEPLOY_PASSWORD }} | |
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | |
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} | |
- name: Release under current tag | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "${{ env.RELEASE_VERSION }}" | |
prerelease: false | |
title: "${{ env.RELEASE_VERSION }}" | |
files: build/libs/*.jar |