Merge pull request #80 from dima-dencep/1.20.x/dev #77
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: Publish Release | |
on: | |
push: | |
branches: | |
- '**/stable' | |
- '**/backport' | |
- '**/snapshot' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 21 | |
- name: Grant execute permission for Gradlew | |
run: chmod +x gradlew | |
- name: Get previous tag | |
run: echo "previous_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo '')" >> $GITHUB_ENV | |
- name: Build Changelog | |
id: build_changelog | |
uses: metcalfc/changelog-generator@v4.2.0 | |
if: env.previous_tag | |
with: | |
myToken: ${{ secrets.GITHUB_TOKEN }} | |
base-ref: ${{ env.previous_tag }} | |
- name: Read value from Properties-file | |
id: read_property | |
uses: christian-draeger/read-properties@1.1.1 | |
with: | |
path: './gradle.properties' | |
properties: 'mod_version minecraft_version' | |
- name: Upload assets to releases | |
run: ./gradlew build | |
env: | |
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | |
- name: Publish Forge to Modrinth & CurseForge | |
uses: Kir-Antipov/mc-publish@v3.3.0 | |
with: | |
modrinth-id: ZP7xHXtw | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
curseforge-id: 833233 | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
files: | | |
forge/build/libs/!(*-@(dev|sources|javadoc|shadow)).jar | |
name: "[NeoForge ${{ steps.read_property.outputs.minecraft_version }}] v${{ steps.read_property.outputs.mod_version }}" | |
changelog: ${{steps.build_changelog.outputs.changelog}} | |
version: "${{ steps.read_property.outputs.mod_version }}+mc${{ steps.read_property.outputs.minecraft_version }}-forge" | |
version-type: release | |
loaders: | | |
neoforge | |
game-version-filter: none | |
game-versions: | | |
${{ steps.read_property.outputs.minecraft_version }} | |
dependencies: | | |
recs(optional){modrinth:VbyJLvvb}{curseforge:457570} | |
java: | | |
21 | |
- name: Publish Fabric to Modrinth & CurseForge | |
uses: Kir-Antipov/mc-publish@v3.3.0 | |
with: | |
modrinth-id: ZP7xHXtw | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
curseforge-id: 833233 | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
files: | | |
fabric/build/libs/!(*-@(dev|sources|javadoc|shadow)).jar | |
name: "[Fabric ${{ steps.read_property.outputs.minecraft_version }}] v${{ steps.read_property.outputs.mod_version }}" | |
changelog: ${{steps.build_changelog.outputs.changelog}} | |
version: "${{ steps.read_property.outputs.mod_version }}+mc${{ steps.read_property.outputs.minecraft_version }}-fabric" | |
version-type: release | |
loaders: | | |
fabric | |
game-version-filter: none | |
game-versions: | | |
${{ steps.read_property.outputs.minecraft_version }} | |
dependencies: | | |
cloth-config | |
modmenu(optional) | |
java: | | |
21 | |
- name: Publish Fabric & Forge to Github | |
uses: Kir-Antipov/mc-publish@v3.3.0 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
github-tag: "${{ steps.read_property.outputs.minecraft_version }}-${{ steps.read_property.outputs.mod_version }}" | |
files: | | |
forge/build/libs/!(*-@(dev|sources|javadoc|shadow)).jar | |
fabric/build/libs/!(*-@(dev|sources|javadoc|shadow)).jar | |
name: "[${{ steps.read_property.outputs.minecraft_version }}] v${{ steps.read_property.outputs.mod_version }}" | |
changelog: ${{steps.build_changelog.outputs.changelog}} | |
version-type: release |