build: 👷 update ci #19
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 | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
name: Release Please | |
outputs: | |
release_created: ${{ steps.release-please.outputs.release_created }} | |
tag_name: ${{ steps.release-please.outputs.tag_name }} | |
steps: | |
- name: Release Please | |
uses: google-github-actions/release-please-action@v4 | |
id: release-please | |
with: | |
config-file: .release-please/release-please-config.json | |
manifest-file: .release-please/.release-please-manifest.json | |
build-and-publish: | |
runs-on: ubuntu-latest | |
name: Build and Publish | |
needs: release-please | |
if: ${{ needs.release-please.outputs.release_created == 'true' }} | |
steps: | |
- name: Parse Version | |
id: version | |
run: echo "version=$(echo "${{ needs.release-please.outputs.tag_name }}" | cut -c 2-)" >> "$GITHUB_OUTPUT" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
cache: maven | |
- name: Build with Maven | |
run: mvn --batch-mode --update-snapshots package | |
- name: Rename artifact | |
run: mv target/*-jar-with-dependencies.jar ChatHub-${{ steps.version.outputs.version }}.jar | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Generate Latest Changelog | |
run: npx changelogithub --output LATEST_CHANGELOG.md | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Publish | |
uses: Kir-Antipov/[email protected] | |
with: | |
version: ChatHub-${{ steps.version.outputs.version }} | |
modrinth-id: H3USaks7 | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
curseforge-id: 825508 | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
ChatHub-${{ steps.version.outputs.version }}.jar | |
changelog-file: LATEST_CHANGELOG.md | |
loaders: | | |
velocity | |
game-versions: | | |
[1.12,) | |
game-version-filter: releases |