Build #40 #40
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: Build | |
run-name: "Build #${{ github.run_number }}" | |
on: | |
push: | |
tags: | |
- 'v*' | |
branches: | |
- main | |
paths-ignore: | |
- 'docs/**' | |
- '*.md' | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- '*.md' | |
jobs: | |
changelog: | |
name: Changelog | |
runs-on: ubuntu-latest | |
outputs: | |
latest_tag: ${{ steps.changelog.outputs.latest_tag }} | |
version: ${{ steps.changelog.outputs.version }} | |
rel_type: ${{ steps.changelog.outputs.rel_type }} | |
changelog_text: ${{ steps.changelog.outputs.changelog_text }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get Changelog | |
id: changelog | |
shell: bash | |
run: | | |
latest_tag=$(git describe --tags --abbrev=0) | |
mkdir changelog | |
{ grep --color=auto -Pzo "(?<=## $latest_tag)((?!\n## )[\s\S])*" ./CHANGELOG.md || true; } | sed '$ s/.$//' > ./changelog/CHANGELOG.md | |
rel_type="release" | |
case $latest_tag in | |
*alpha*) rel_type="alpha" ;; | |
*beta*) rel_type="beta" ;; | |
*) rel_type="release" ;; | |
esac | |
echo "latest_tag=$latest_tag" >> $GITHUB_OUTPUT | |
echo "version=${latest_tag/v}" >> $GITHUB_OUTPUT | |
echo "rel_type=$rel_type" >> $GITHUB_OUTPUT | |
{ | |
echo 'changelog_text<<EOF' | |
cat ./changelog/CHANGELOG.md | |
echo EOF | |
} >> $GITHUB_OUTPUT | |
- name: Upload Changelog | |
uses: actions/upload-artifact@v4 | |
with: | |
name: changelog | |
path: ${{ github.workspace }}/changelog/** | |
build-jvm-jar: | |
name: Build JVM Jar | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
cache: 'gradle' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build the mod | |
run: ./gradlew --no-daemon build | |
- name: Upload JVM Jar | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jvm-jar | |
path: build/libs/* | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: [changelog, build-jvm-jar] | |
permissions: | |
contents: write | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Download Artifact Changelog | |
uses: actions/download-artifact@v4 | |
with: | |
name: changelog | |
- name: Download Artifact JVM Jar | |
uses: actions/download-artifact@v4 | |
with: | |
name: jvm-jar | |
path: build/libs/ | |
- uses: Kir-Antipov/[email protected] | |
with: | |
modrinth-id: EVaCo3rr | |
modrinth-token: ${{ secrets.MR_TOKEN }} | |
curseforge-id: 574029 | |
curseforge-token: ${{ secrets.CF_TOKEN }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
game-versions: | | |
[1.12,1.12.2) | |
loaders: | | |
forge | |
dependencies: | | |
fluidlogged-api | |
forgelin-continuous | |
changelog-file: ./NEW_CHANGELOG.md |