Skip to content

ci: Add a Github Action to automatically generate and update sounds.j… #2

ci: Add a Github Action to automatically generate and update sounds.j…

ci: Add a Github Action to automatically generate and update sounds.j… #2

Workflow file for this run

name: Publish Release
on:
push:
branches:
- release
jobs:
changelog:
name: Generate Changelog
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.changelog.outputs.tag }}
skipped: ${{ steps.changelog.outputs.skipped }}
clean_changelog: ${{ steps.changelog.outputs.clean_changelog }}
changelog: ${{ steps.changelog.outputs.changelog }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: 16
- run: |
npm install [email protected]
npm install [email protected]
- name: Set up version.json
run: echo "{"version":$(git describe --tags --abbrev=0)}" > version.json
- name: Create changelog
id: changelog
uses: TriPSs/[email protected]
with:
github-token: ${{ secrets.PRIVATE_TOKEN }}
git-user-name: 'VoWBot'
git-user-email: '[email protected]'
pre-commit: ./.github/.pre-commit.js
config-file-path: ./.github/.config.js
version-file: ./version.json
skip-version-file: true
skip-git-pull: true
pre-release: false
release-count: 5
- name: Create release
if: ${{ steps.changelog.outputs.skipped != 'true' }}
id: release
uses: softprops/[email protected]
with:
tag_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
draft: true
prerelease: false
- name: Upload version information
uses: actions/upload-artifact@v4
with:
name: build
path: build.gradle
build:
name: Build
needs: [changelog] # Build needs the new version number
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4 # Download version information from changelog
with:
name: build
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 21
cache: "gradle"
- name: Build with Gradle
uses: gradle/actions/setup-gradle@v3
with:
arguments: buildDependents -x spotlessCheck -x test
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: build
path: |
**/build/libs/*-fabric+MC-*.jar
if-no-files-found: error
overwrite: true
release-github:
name: Release to Github
if: ${{ needs.changelog.outputs.skipped != 'true' }}
runs-on: ubuntu-latest
needs: [ build, changelog ]
steps:
- name: Download build
uses: actions/download-artifact@v4
with:
name: build
- name: Create release and upload files
if: ${{ needs.changelog.outputs.skipped != 'true' }}
id: release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.changelog.outputs.tag }}
body: ${{ needs.changelog.outputs.changelog }}
draft: false
prerelease: false
files: |
**/build/libs/*-fabric+MC-*.jar
- name: Set current date
id: date
run: |
echo "::set-output name=short::$(date +'%Y-%m-%d')"
echo "::set-output name=long::$(date +'%Y-%m-%d %H:%M')"
- name: Post release on Discord
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}
embed-color: "4915330"
embed-title: ${{format('Voices of Wynn {0}', needs.changelog.outputs.tag)}}
embed-description: ${{ needs.changelog.outputs.changelog }}
embed-url: ${{ steps.release.outputs.url }}
embed-timestamp: ${{ steps.date.outputs.long }}
release-external:
name: Release to CurseForge
if: ${{ needs.changelog.outputs.skipped != 'true' }}
strategy:
matrix:
modloader: [fabric]
runs-on: ubuntu-latest
needs: [build, changelog]
steps:
- name: Download build
uses: actions/download-artifact@v4
with:
name: build
- uses: Kir-Antipov/[email protected]
with:
curseforge-id: 857921
curseforge-token: ${{ secrets.CF_API_TOKEN }}
files: "**/build/libs/*-${{ matrix.modloader }}*.jar"
name: Voices of Wynn (${{ matrix.modloader }}) ${{ needs.changelog.outputs.tag }}
version: ${{ needs.changelog.outputs.tag }}
version-type: release
game-versions: 1.21
changelog: ${{ needs.changelog.outputs.changelog }}
loaders: ${{ matrix.modloader }}
java: 21