Skip to content

Commit

Permalink
chore: update github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
klikli-dev committed Jun 14, 2024
1 parent b82bff0 commit 85e2f0c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/build_and_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,42 @@ 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@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
- name: Build
run: ./gradlew build
env:
MOD_VERSION: ${{ steps.get_version.outputs.result }}
- name: Update CHANGELOG
Expand Down Expand Up @@ -97,7 +98,7 @@ jobs:
artifacts: fabric/build/libs/modonomicon-${{ steps.get_mc_version.outputs.result }}-fabric-${{ steps.get_version.outputs.result }}.jar,fabric/build/libs/modonomicon-${{ steps.get_mc_version.outputs.result }}-fabric-${{ steps.get_version.outputs.result }}-sources.jar,common/build/libs/modonomicon-${{ steps.get_mc_version.outputs.result }}-common-${{ steps.get_version.outputs.result }}.jar,common/build/libs/modonomicon-${{ steps.get_mc_version.outputs.result }}-common-${{ steps.get_version.outputs.result }}-sources.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 @@ -181,10 +182,9 @@ jobs:
jei(optional)
# Publish at the end because it creates a non reobfed jarjar which otherwise would be distributed
- name: Publish
uses: gradle/gradle-build-action@v2
run: ./gradlew publish
if: ${{ steps.get_release_type.outputs.result != 'test' }}
with:
arguments: publish
gradle-home-cache-cleanup: true
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
Expand Down

0 comments on commit 85e2f0c

Please sign in to comment.