fix build #61
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 Plazma (1.20.6) | |
on: | |
push: | |
branches: [ "ver/*", "dev/*", "feat/**/*" ] | |
paths: | |
- "**.patch" | |
workflow_dispatch: | |
env: | |
ORG_NAME: PlazmaMC | |
MC_VERSION: 1.20.6 | |
jobs: | |
release: | |
name: Release Plazma | |
strategy: | |
matrix: | |
base_jdk: [21] | |
os: [ubuntu-22.04] | |
if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Setup Variables | |
id: setup | |
env: | |
BRANCH: ${{ github.ref_name }} | |
run: echo "branch=${BRANCH##*/}" >> $GITHUB_OUTPUT | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Checkout javadocs | |
uses: actions/checkout@v4 | |
continue-on-error: true | |
if: startsWith(github.ref_name, 'ver/') || startsWith(github.ref_name, 'dev/') | |
with: | |
repository: PlazmaMC/Javadocs | |
path: javadoc | |
ref: ${{ steps.setup.outputs.branch }} | |
token: ${{ secrets.GH_PAT }} | |
- name: Checkout javadocs | |
uses: actions/checkout@v4 | |
if: startsWith(github.ref_name, 'ver/') || startsWith(github.ref_name, 'dev/') | |
with: | |
repository: PlazmaMC/Javadocs | |
path: jdmain | |
token: ${{ secrets.GH_PAT }} | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Set up GraalVM ${{ matrix.base_jdk }} | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
java-version: ${{ matrix.base_jdk }} | |
version: latest | |
cache: 'gradle' | |
- name: Configure Git | |
run: git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" && git config --global user.name "github-actions[bot]" | |
- name: Apply Patches | |
run: ./gradlew applyPatches --stacktrace | |
- name: Build | |
run: ./gradlew build --stacktrace | |
- name: Create Reobf Jar | |
run: ./gradlew createReobfPaperclipJar --stacktrace | |
- name: Create Mojmap Jar | |
run: ./gradlew createMojmapPaperclipJar --stacktrace | |
- name: Update Javadoc | |
if: startsWith(github.ref_name, 'ver/') || startsWith(github.ref_name, 'dev/') | |
continue-on-error: true | |
run: | | |
if [ ! -d "javadoc" ]; then | |
mkdir javadoc | |
cd javadoc | |
git init && git branch -m ${{ steps.setup.outputs.branch }} | |
git remote add origin https://github.com/PlazmaMC/Javadocs | |
fi | |
(cd Plazma-API/build/docs/javadoc && tar c .) | (cd javadoc && tar xf -) | |
cd javadoc | |
git add . && git commit -m "Update Javadocs" | |
git push -f | |
cd ../jdmain | |
git submodule update | |
git add . && git commit -m "Update Javadocs" | |
git push | |
- name: Publish Packages | |
if: startsWith(github.ref_name, 'ver/') || startsWith(github.ref_name, 'dev/') | |
run: | | |
export GITHUB_USERNAME=${{ env.ORG_NAME }} | |
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} | |
./gradlew publish --stacktrace | |
- name: Get Release Number | |
if: startsWith(github.ref_name, 'ver/') | |
run: echo "RELEASE=$(git ls-remote --tags origin | grep "build/${{ env.MC_VERSION }}" | wc -l)" >> $GITHUB_ENV | |
- name: Release Artifacts | |
if: startsWith(github.ref_name, 'ver/') | |
uses: softprops/[email protected] | |
with: | |
name: "Build #${{ env.RELEASE }} for ${{ env.MC_VERSION }}" | |
tag_name: build/${{ env.MC_VERSION }}/${{ env.RELEASE }} | |
target_commitish: ${{ github.ref_name }} | |
generate_release_notes: true | |
fail_on_unmatched_files: true | |
files: build/libs/*.jar | |
- name: Release Artifacts (Latest/Stable) | |
if: startsWith(github.ref_name, 'ver/') | |
uses: softprops/[email protected] | |
with: | |
name: "Build #${{ env.RELEASE }} for ${{ env.MC_VERSION }}" | |
tag_name: build/${{ env.MC_VERSION }}/latest | |
target_commitish: ${{ github.ref_name }} | |
generate_release_notes: true | |
fail_on_unmatched_files: true | |
files: build/libs/*.jar | |
- name: Release Artifacts (Latest/Development) | |
if: startsWith(github.ref_name, 'dev/') | |
uses: softprops/[email protected] | |
with: | |
name: "Development Build for ${{ env.MC_VERSION }}" | |
tag_name: build/${{ env.MC_VERSION }}/latest | |
target_commitish: ${{ github.ref_name }} | |
generate_release_notes: true | |
fail_on_unmatched_files: true | |
files: build/libs/*.jar |