mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-26 02:09:30 +00:00
74 lines
2.1 KiB
YAML
74 lines
2.1 KiB
YAML
name: Build DivineMC
|
|
on:
|
|
push:
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
version: '1.20.6'
|
|
branch: 'ver/1.20.6'
|
|
debug: 'false'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
if: "!contains(github.event.commits[0].message, '[ci-skip]')"
|
|
steps:
|
|
- name: Setup Action
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/gradle-build-action@v2
|
|
|
|
- name: Setup JDK 21
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
distribution: temurin
|
|
java-version: 21
|
|
cache: 'gradle'
|
|
|
|
- name: Configure Git and Gradle
|
|
run: |
|
|
git config --global user.email "no-reply@github.com" && git config --global user.name "Github Actions"
|
|
echo "workflow=$GITHUB_RUN_NUMBER" >> $GITHUB_ENV
|
|
chmod +x gradlew
|
|
|
|
- name: Patch
|
|
run: ./gradlew applyPatches --stacktrace
|
|
|
|
- name: Create Reobf Jar
|
|
run: ./gradlew createReobfPaperclipJar --stacktrace
|
|
|
|
- name: Create Mojmap Jar
|
|
run: ./gradlew createMojmapPaperclipJar --stacktrace
|
|
|
|
- name: Publish API
|
|
continue-on-error: true
|
|
run: ./gradlew publish -PdivinemcUsername=${{ secrets.REPO_USERNAME }} -PdivinemcPassword=${{ secrets.REPO_SECRET }}
|
|
|
|
- name: Upload Artifacts
|
|
if: env.debug == 'true' || github.ref_name != env.branch
|
|
uses: actions/upload-artifact@main
|
|
with:
|
|
name: Artifacts
|
|
path: build/libs
|
|
|
|
- name: Release Artifacts
|
|
if: github.ref_name == env.branch
|
|
uses: marvinpinto/action-automatic-releases@latest
|
|
with:
|
|
title: "Release #${{ env.workflow }}"
|
|
automatic_release_tag: release-${{ env.workflow }}
|
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
files: build/libs/*.jar
|
|
prerelease: false
|
|
|
|
- name: Release Artifacts (Latest)
|
|
if: github.ref_name == env.branch
|
|
uses: marvinpinto/action-automatic-releases@latest
|
|
with:
|
|
title: "Release #${{ env.workflow }}"
|
|
automatic_release_tag: latest-${{ env.version }}
|
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
files: build/libs/*.jar
|
|
prerelease: false
|