Skip to content

Test bump 2.3 (fix download) #27

Test bump 2.3 (fix download)

Test bump 2.3 (fix download) #27

Workflow file for this run

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Build and Uploading
on:
push:
branches:
- main
- upload-ci-test
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+)*)'
- run: echo 'New version is ${{ steps.match.outputs.group1 }}'
outputs:
new_ver: ${{ steps.match.outputs.group1 }}
build:
needs:
- check-commit
runs-on: ubuntu-latest
if: ${{ needs.check-commit.outputs.new_ver != '' }}
steps:
- run: echo '$GITHUB_WORKSPACE'
- run: echo 'Compiling for version ${{ needs.check-commit.outputs.new_ver }}'
- 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
upload-curseforge:
needs:
- build
runs-on: ubuntu-latest
if: ${{ needs.check-commit.outputs.new_ver != '' }}
steps:
- name: "Extract changelog"
id: extract-changelog
uses: sean0x42/markdown-extract@v2
with:
file: CHANGELOG.md
pattern: ${{ needs.check-commit.outputs.new_ver }}
- name: "Log changelog"
run: echo '${{ steps.extract-changelog.outputs.markdown }}'
- uses: actions/download-artifact@v3
with:
name: ${{ needs.check-commit.outputs.new_ver }}
- name: Display structure of downloaded files
run: ls -R
# - name: "Upload to CurseForge"
# uses: itsmeow/[email protected]
# with:
# token: ${{ secrets.CURSEFORGE_TOKEN }}
# project_id: 933999
# game_endpoint: "minecraft"
# file_path:
# changelog: ${{ steps.extract-changelog.outputs.markdown }}