fix: build: extract jar #35
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 | |
on: [ push, pull_request, workflow_dispatch ] | |
jobs: | |
build: | |
if: ${{ !contains(github.head_ref, 'translations/') }} | |
runs-on: ubuntu-latest | |
env: | |
ORG_GRADLE_PROJECT_buildNumber: ${{ github.run_number }} | |
ORG_GRADLE_PROJECT_runAttempt: ${{ github.run_attempt }} | |
ORG_GRADLE_PROJECT_runningOnCi: ${{ true }} | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
cache: 'gradle' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew build --no-daemon | |
- name: Read Project Version | |
id: read_property_sba_version | |
uses: christian-draeger/[email protected] | |
with: | |
path: gradle.properties | |
properties: version | |
- name: Read MC Version | |
id: read_property_mc_version | |
uses: christian-draeger/[email protected] | |
with: | |
path: gradle.properties | |
properties: minecraftVersion | |
- name: Extract Jar | |
run: mkdir build/libs/extract | cp build/libs/SkyblockAddons-${{ steps.read_property_sba_version.outputs.version }}+${{ github.run_number }}-for-MC-${{ steps.read_property_mc_version.outputs.minecraftVersion }}.jar build/libs/extract/SkyblockAddons-${{ steps.read_property_sba_version.outputs.version }}+${{ github.run_number }}-for-MC-${{ steps.read_property_mc_version.outputs.minecraftVersion }}.zip | cd build/libs/extract/unzip | jar xf "SkyblockAddons-${{ steps.read_property_sba_version.outputs.version }}+${{ github.run_number }}-for-MC-${{ steps.read_property_mc_version.outputs.minecraftVersion }}.jar" | mv -v "build/libs/extract/SkyblockAddons-${{ steps.read_property_sba_version.outputs.version }}+${{ github.run_number }}-for-MC-${{ steps.read_property_mc_version.outputs.minecraftVersion }}" build/libs/extract/unzip | |
- name: Upload Artifact | |
env: | |
project_version: ${{ steps.read_properties.outputs.version }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: SkyblockAddons-${{ steps.read_property_sba_version.outputs.version }}+${{ github.run_number }}-for-MC-${{ steps.read_property_mc_version.outputs.minecraftVersion }} | |
path: build/libs/extract/* | |
- name: Preprare Release | |
run: cp build/libs/SkyblockAddons-${{ steps.read_property_sba_version.outputs.version }}+${{ github.run_number }}-for-MC-${{ steps.read_property_mc_version.outputs.minecraftVersion }}.jar build/libs/rename/SkyblockAddons.jar | |
- name: Release | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "latest" | |
prerelease: false | |
title: "SkyblockAddons ${{ steps.read_property_sba_version.outputs.version }}+${{ github.run_number }} for Forge ${{ steps.read_property_mc_version.outputs.minecraftVersion }}" | |
files: build/libs/rename/SkyblockAddons.jar |