This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
Build JAR Artifact #100
Workflow file for this run
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 JAR Artifact | |
#on push to master or tag | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
tags: | |
- 'v*' | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
# if tag is present adjust pom version | |
- if: startsWith(github.ref, 'refs/tags/v') | |
name: Correct pom version as per tag name | |
run: mvn -B versions:set -DnewVersion="${{ github.ref_name }}" -DgenerateBackupPoms=false | |
- name: Configure application-prod.properties | |
run: | | |
python -c "import os; file = open('src/main/resources/application-prod.properties', 'w'); file.write(os.environ['APPLICATION_PROD_PROPERTIES']); file.close()" | |
env: | |
APPLICATION_PROD_PROPERTIES : ${{secrets.APPLICATION_PROD_PROPERTIES}} | |
- name: Build with Maven | |
run: mvn -B clean package -Pprod | |
- name: Upload JAR Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: asa_sm_jar | |
path: target/asa_sm.jar | |
release: | |
needs: build | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: celedev97/asa-server-manager/.github/workflows/release.yml@master | |
with: | |
version: ${{ github.ref_name }} |