pointmark JAR release #33
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: pointmark JAR release | |
on: | |
workflow_dispatch: | |
release: | |
types: [created] | |
jobs: | |
build_jar: | |
name: build pointmark JAR | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
id: checkout_repo | |
uses: actions/checkout@v4 | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
id: jdk_setup | |
with: | |
distribution: 'adopt' | |
java-version: '11' | |
- name: Build JAR | |
run: bash ./.github/scripts/build-jar.sh | |
- name: Rename JAR | |
run: | | |
cd target | |
cp CoordinateExporter-0.1.0-SNAPSHOT.jar pointmark-1.0.0.jar | |
- name: Check if tag exists | |
id: check_tag | |
run: | | |
TAG_NAME="v${GITHUB_RUN_NUMBER}" | |
if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then | |
echo "TAG_EXISTS=true" >> $GITHUB_ENV | |
else | |
echo "TAG_EXISTS=false" >> $GITHUB_ENV | |
fi | |
- name: Create and push tag if it doesn't exist | |
if: env.TAG_EXISTS == 'false' | |
run: | | |
TAG_NAME="v${GITHUB_RUN_NUMBER}" | |
git tag $TAG_NAME | |
git push origin $TAG_NAME | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload release assets | |
id: upload_assets | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: target/pointmark-1.0.0.jar | |
tag_name: "v1.0.0" | |
release_name: Release v1.0.0 | |
prerelease: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |