Skip to content

21.1.0 (Minecraft 1.21.1) #24

21.1.0 (Minecraft 1.21.1)

21.1.0 (Minecraft 1.21.1) #24

Workflow file for this run

name: 'Release'
on:
release:
types: [ published ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
outputs:
ARTIFACT_PATH: ${{ steps.prepare_artifact_metadata.outputs.ARTIFACT_PATH }}
ARTIFACT_NAME: ${{ steps.prepare_artifact_metadata.outputs.ARTIFACT_NAME }}
JAVADOC_PATH: ${{ steps.prepare_artifact_metadata.outputs.JAVADOC_PATH }}
JAVADOC_NAME: ${{ steps.prepare_artifact_metadata.outputs.JAVADOC_NAME }}
API_PATH: ${{ steps.prepare_artifact_metadata.outputs.API_PATH }}
API_NAME: ${{ steps.prepare_artifact_metadata.outputs.API_NAME }}
VERSION: ${{ steps.prepare_artifact_metadata.outputs.VERSION }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 50
- run: git fetch origin --tags
shell: bash
- uses: ./.github/actions/gradle-setup
- name: Build with Gradle
run: ./gradlew printProjectVersion build publish -x check --max-workers 1
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_KEY_PASSWORD }}
- name: Prepare artifact metadata. Note that VERSION is set by the gradle script.
id: prepare_artifact_metadata
run: |
echo ARTIFACT_PATH=./build/libs/guideme-${VERSION}.jar >> $GITHUB_OUTPUT
echo ARTIFACT_NAME=guideme-${VERSION}.jar >> $GITHUB_OUTPUT
echo JAVADOC_PATH=./build/libs/guideme-${VERSION}-javadoc.jar >> $GITHUB_OUTPUT
echo JAVADOC_NAME=guideme-${VERSION}-javadoc.jar >> $GITHUB_OUTPUT
echo API_PATH=./build/libs/guideme-${VERSION}-api.jar >> $GITHUB_OUTPUT
echo API_NAME=guideme-${VERSION}-api.jar >> $GITHUB_OUTPUT
echo VERSION=${VERSION} >> $GITHUB_OUTPUT
- name: Archive build results
run: tar -I zstd -cf build.tar.zst build/libs build/repo
- name: Upload build and gradle folders
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: build.tar.zst
if-no-files-found: error
retention-days: 3
upload-release-artifacts:
name: Upload Release Artifacts
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build-artifacts
- name: Unpack build artifact
run: tar axf build.tar.zst
- name: Upload Release Artifact
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ needs.build.outputs.ARTIFACT_PATH }}
asset_name: ${{ needs.build.outputs.ARTIFACT_NAME }}
asset_content_type: application/zip
- name: Upload Javadocs Artifact
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ needs.build.outputs.JAVADOC_PATH }}
asset_name: ${{ needs.build.outputs.JAVADOC_NAME }}
asset_content_type: application/zip
- name: Upload API
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ needs.build.outputs.API_PATH }}
asset_name: ${{ needs.build.outputs.API_NAME }}
asset_content_type: application/zip
deploy-github-packages:
name: Deploy to Github Packages
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build-artifacts
- name: Unpack build artifact
run: tar axf build.tar.zst
- name: Validate artifacts exist
run: test -d ./build
- name: Publish to Github Packages
uses: AppliedEnergistics/maven-publish-action@main
with:
local-repository-path: build/repo
remote-repository-url: https://maven.pkg.github.com/AppliedEnergistics/GuideME/
remote-repository-username: ${{ github.actor }}
remote-repository-password: ${{ github.token }}
deploy-maven-central:
name: Deploy to Maven Central
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build-artifacts
- name: Unpack build artifact
run: tar axf build.tar.zst
- name: Validate artifacts exist
run: test -d ./build
- name: Publish to Maven Central
uses: AppliedEnergistics/maven-central-publish-action@main
with:
local-repository-path: build/repo
username: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
deploy-curseforge:
name: Deploy to Curseforge
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build-artifacts
- name: Unpack build artifact
run: tar axf build.tar.zst
- name: Validate artifacts exist
run: test -d ./build
- name: Upload to Curseforge
uses: Kir-Antipov/mc-publish@995edadc13559a8b28d0b7e6571229f067ec7659
with:
name: GuideME ${{ needs.build.outputs.VERSION }}
version: ${{ needs.build.outputs.VERSION }}
files: ${{ needs.build.outputs.ARTIFACT_PATH }}
curseforge-id: 1173950
curseforge-token: ${{ secrets.CURSEFORGE }}
loaders: neoforge
deploy-modrinth:
name: Deploy to Modrinth
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build-artifacts
- name: Unpack build artifact
run: tar axf build.tar.zst
- name: Validate artifacts exist
run: test -d ./build
- name: Upload to Modrinth
uses: Kir-Antipov/mc-publish@995edadc13559a8b28d0b7e6571229f067ec7659
with:
name: GuideME ${{ needs.build.outputs.VERSION }}
version: ${{ needs.build.outputs.VERSION }}
files: ${{ needs.build.outputs.ARTIFACT_PATH }}
modrinth-id: Ck4E7v7R
modrinth-token: ${{ secrets.MODRINTH }}
loaders: neoforge