code cleanup, (strictly reformat) #39
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: Create Plugin.jar | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Project | |
uses: actions/checkout@v4 | |
- name: Setup Java 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'zulu' | |
cache: maven | |
- name: Build and Package Plugin | |
run: | | |
artifactPath="$(pwd)/target" | |
artifactName="$(mvn help:evaluate -Dexpression=project.build.finalName -q -DforceStdout)" | |
git_hash=$(git rev-parse --short "$GITHUB_SHA") | |
echo "artifactPath=${artifactPath}" >> $GITHUB_ENV | |
echo "artifactName=${artifactName}" >> $GITHUB_ENV | |
echo git_hash=${git_hash} >> $GITHUB_ENV | |
mvn clean package | |
mv "${artifactPath}/${artifactName}.jar" "${artifactPath}/${artifactName}-${git_hash}.jar" | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.artifactName }}-${{ env.git_hash }}.jar | |
path: ${{ env.artifactPath }}/${{ env.artifactName }}-${{ env.git_hash }}.jar |