build #282
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: | |
workflow_dispatch: | |
create: | |
tag: '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
release_id: ${{ steps.release.outputs.id }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 19 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 19 | |
cache: maven | |
- name: Build with Maven | |
run: mvn -B package --file pom.xml | |
- name: Clean up artifacts | |
run: rm target/original-*.jar | |
- name: Release | |
id: release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: "ServerTap ${{ github.ref_name }}" | |
body_path: CHANGELOG.md | |
draft: true | |
files: target/*.jar | |
# use a separate step to un-draft the release in case the build fails | |
finalize-release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Publish release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: eregon/publish-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
release_id: ${{ needs.build.outputs.release_id }} |