Merge pull request #27 from finos/dschwartznyc-patch-1 #25
Workflow file for this run
This file contains hidden or 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 on Tag | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # Ensure write permission for contents | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' # Matches the enforced version in the POM | |
| cache: maven | |
| - name: Cache Maven dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| - name: Build with Maven | |
| run: | | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| echo "Updating POM version to $TAG_NAME" | |
| mvn -B versions:set -DnewVersion=$TAG_NAME | |
| mvn -B package | |
| - name: Revert POM changes | |
| run: git checkout -- pom.xml | |
| - name: Upload JAR files | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jar-files | |
| path: target/*.jar | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: target/*.jar | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |