Skip to content

Commit

Permalink
chore: update github action
Browse files Browse the repository at this point in the history
  • Loading branch information
klikli-dev committed Jun 16, 2024
1 parent a357770 commit 03b93d6
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/build_and_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,51 +13,43 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up OpenJDK 21
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
- name: Get release type from github tag
id: get_release_type
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ secrets.RELEASE_NOTES_TOKEN }}
result-encoding: string
script: |
return '${{ github.ref }}'.match(/refs\/tags\/(.*)\/v((.*)-(.*))/)[1];
- name: Get file version from tag
id: get_version
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ secrets.RELEASE_NOTES_TOKEN }}
result-encoding: string
script: |
return '${{ github.ref }}'.match(/refs\/tags\/(.*)\/v((.*)-(.*))/)[4];
- name: Get main mc version from tag
id: get_mc_version
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ secrets.RELEASE_NOTES_TOKEN }}
result-encoding: string
script: |
return '${{ github.ref }}'.match(/refs\/tags\/(.*)\/v((.*)-(.*))/)[3];
- name: Build
uses: gradle/gradle-build-action@v2
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
arguments: build
gradle-home-cache-cleanup: true
env:
MOD_VERSION: ${{ steps.get_version.outputs.result }}
- name: Publish
uses: gradle/gradle-build-action@v2
with:
arguments: publish
gradle-home-cache-cleanup: true
- name: Build
run: ./gradlew build
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
MOD_VERSION: ${{ steps.get_version.outputs.result }}
- name: Update CHANGELOG
id: changelog
Expand All @@ -79,7 +71,7 @@ jobs:
artifacts: ./build/libs/theurgy-${{ steps.get_mc_version.outputs.result }}-neoforge-${{ steps.get_version.outputs.result }}.jar
artifactContentType: application/java-archive
- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
if: ${{ steps.get_release_type.outputs.result != 'test' }}
with:
branch: version/1.21
Expand Down Expand Up @@ -112,4 +104,12 @@ jobs:
modonomicon(required)
geckolib(required)
jei(optional)
jade(optional)
jade(optional)
# Publish at the end because it creates a non reobfed jarjar which otherwise would be distributed
- name: Publish
run: ./gradlew publish
if: ${{ steps.get_release_type.outputs.result != 'test' }}
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
MOD_VERSION: ${{ steps.get_version.outputs.result }}

0 comments on commit 03b93d6

Please sign in to comment.