Re-bump 2.7.0 #63
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 and Uploading | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
check-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Match commit message" | |
id: match | |
uses: kaisugi/[email protected] | |
with: | |
text: ${{ github.event.head_commit.message }} | |
regex: '[bB]ump.*?(\d+(\.\d+)*)' | |
- name: "Exit if no match" | |
if: ${{ steps.match.outputs.group1 == '' }} | |
run: | | |
echo 'Not a new version.' > $GITHUB_STEP_SUMMARY | |
exit 1 | |
- name: "Checking out" | |
uses: actions/checkout@v3 | |
- name: "List files" | |
run: ls -R | |
- name: "Extract changelog" | |
id: extract-changelog | |
uses: sean0x42/markdown-extract@v2 | |
with: | |
file: CHANGELOG.md | |
pattern: ${{ steps.match.outputs.group1 }} | |
- name: "Summary" | |
run: | | |
echo '${{ steps.extract-changelog.outputs.markdown }}' >> $GITHUB_STEP_SUMMARY | |
outputs: | |
new_ver: ${{ steps.match.outputs.group1 }} | |
changelog: ${{ steps.extract-changelog.outputs.markdown }} | |
build: | |
needs: | |
- check-commit | |
runs-on: ubuntu-latest | |
if: ${{ needs.check-commit.outputs.new_ver != '' }} | |
steps: | |
- name: "Display version" | |
run: echo 'Compiling for version ${{ needs.check-commit.outputs.new_ver }}' | |
- name: "Checking out" | |
uses: actions/checkout@v3 | |
- name: "Set up java" | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'corretto' # See 'Supported distributions' for available options | |
java-version: '17' | |
cache: maven | |
- name: "Build the jar" | |
run: mvn --batch-mode --update-snapshots verify | |
- name: "Upload artifact" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ needs.check-commit.outputs.new_ver }} | |
path: | | |
**/*.jar | |
!**/original-*.jar | |
publish: | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
if: ${{ needs.check-commit.outputs.new_ver != '' }} | |
steps: | |
- name: "MCPublish" | |
uses: Kir-Antipov/[email protected] | |
with: | |
modrinth-id: XOp04Yi2 | |
modrinth-featured: true | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
curseforge-id: 933999 | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
github-tag: v${{ needs.check-commit.outputs.new_ver }} | |
game-versions: ">=1.16.5" | |
version: ${{ needs.check-commit.outputs.new_ver }} | |
files: | | |
!**/original-*.jar | |
**/*.jar | |
changelog: ${{ needs.check-commit.outputs.changelog }} |