Upload Release Artifacts #20
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: Upload Release Artifacts | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'microsoft' | |
java-version: 17 | |
- name: Get current time | |
uses: srfrnk/current-time@master | |
id: current-time | |
with: | |
format: YYYYMMDDHHmmss | |
- name: Setup ENV | |
run: echo "TAG=${{github.ref_name}}" >> $GITHUB_ENV | |
- name: Copy Maven Upload URL | |
id: extract_maven_upload_url | |
run: echo "maven_upload_url=${{secrets.MAVEN_UPLOAD_URL}}" >> $GITHUB_OUTPUT | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew | |
- name: Build with Gradle | |
env: | |
BUILD_TIME: ${{ steps.current-time.outputs.formattedTime }} | |
BUILD_NUMBER: ${{ github.run_number }} | |
run: ./gradlew assemble | |
- name: Maven Release | |
if: steps.extract_maven_upload_url.outputs.maven_upload_url | |
env: | |
BUILD_TIME: ${{ steps.current-time.outputs.formattedTime }} | |
BUILD_NUMBER: ${{ github.run_number }} | |
MAVEN_UPLOAD_URL: ${{ secrets.MAVEN_UPLOAD_URL }} | |
MAVEN_UPLOAD_USERNAME: ${{ secrets.MAVEN_UPLOAD_USERNAME }} | |
MAVEN_UPLOAD_PASSWORD: ${{ secrets.MAVEN_UPLOAD_PASSWORD }} | |
run: ./gradlew publish --no-daemon --max-workers 1 | |
- name: Publish | |
uses: Kir-Antipov/mc-publish@v3.3 | |
with: | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
github-token: ${{ github.token }} | |
version-type: beta |