Auto Build And Release YSOMAP #4
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-release | |
run-name: Auto Build And Release YSOMAP | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build_release: | |
runs-on: ubuntu-22.04 | |
name: build_release | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'adopt' | |
java-version: '8' | |
- name: build | |
run: | | |
mvn clean package -DskipTests | |
echo "artifactPath=$(pwd)/cli/target" >> $GITHUB_ENV | |
version=$(cat VERSION) | |
tag=${GITHUB_REF_NAME} | |
echo "version=$version" >> $GITHUB_ENV | |
echo "tag=$tag" >> $GITHUB_ENV | |
# debug | |
- run: echo version is ${{ env.version }} | |
- run: echo tag is ${{ env.tag }} | |
- name: release | |
uses: actions/create-release@v1 | |
id: create_release | |
with: | |
draft: true | |
prerelease: false | |
release_name: ${{ env.tag }} | |
tag_name: ${{ env.tag }} | |
body: ${{ env.version }} auto-generated by github actions | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: upload release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ env.artifactPath }}/ysomap.jar | |
asset_name: ysomap.jar | |
asset_content_type: application/java-archive |