Skip to content

Release

Release #28

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
release_type:
description: 'The published artifact release type'
required: false
default: 'STABLE'
type: choice
options:
- STABLE
- BETA
- ALPHA
permissions:
actions: read
contents: write
jobs:
build:
name: Build
runs-on: ubuntu-22.04
outputs:
changelog: ${{ steps.changelog.outputs.changelog }}
container:
image: mcr.microsoft.com/openjdk/jdk:21-ubuntu
options: --user root
steps:
- run: apt update && apt install git -y && git --version
- run: git config --global --add safe.directory /__w/ForgifiedFabricAPI/ForgifiedFabricAPI
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: FabricMC/fabric-action-scripts@v2
id: changelog
with:
context: changelog
workflow_id: release.yml
- uses: gradle/actions/wrapper-validation@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-write-only: true
- name: Build with Gradle
run: ./gradlew clean build --stacktrace
publish:
name: Publish ${{ matrix.name }}
needs: build
runs-on: ubuntu-22.04
environment:
name: ${{ matrix.name }}
url: ${{ matrix.url }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: '21'
- uses: gradle/actions/wrapper-validation@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true
- name: Publish with Gradle
run: ./gradlew clean build publish --stacktrace
env:
PUBLISH_RELEASE_TYPE: ${{ inputs.release_type }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KTT_MAVEN_USERNAME: ${{ secrets.KTT_MAVEN_USERNAME }}
KTT_MAVEN_TOKEN: ${{ secrets.KTT_MAVEN_TOKEN }}
CHANGELOG: ${{ needs.build.outputs.changelog }}