Merge pull request #105 from GiganticMinecraft/refactor/actions #100
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: CD | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
bump: | |
name: Bump version | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Bump version | |
run: ./gradlew releaseVersion --no-commit | |
- name: Push changes | |
run: git push --follow-tags | |
build: | |
name: Build | |
needs: | |
- bump | |
uses: ./.github/workflows/ci.yml | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/actions/output-latest-tag | |
id: latest-tag | |
- name: Download jar | |
uses: actions/download-artifact@v4 | |
with: | |
name: jar | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ steps.latest-tag.outputs.latest-tag }} | |
files: ./*.jar |