From ea4c2abcb9d52e2e207da78645547006e0cb3c7a Mon Sep 17 00:00:00 2001 From: zheng sen he <61687266+meteorOSS@users.noreply.github.com> Date: Thu, 15 Feb 2024 06:31:44 +0800 Subject: [PATCH] Create publish_jar.yml --- .github/workflows/publish_jar.yml | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/publish_jar.yml diff --git a/.github/workflows/publish_jar.yml b/.github/workflows/publish_jar.yml new file mode 100644 index 0000000..db515df --- /dev/null +++ b/.github/workflows/publish_jar.yml @@ -0,0 +1,41 @@ +name: Release on Tag + +on: + push: + branches: [master] + tags: + - 'release-*' + +jobs: + build-and-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + + - name: Build with Maven + run: mvn clean package + + - name: Extract Release Info + id: release_info + run: | + echo "Reading release_info.info..." + VERSION=$(awk -F= '/^VERSION=/ {print $2}' release_info.info) + DESCRIPTION=$(awk '/^DESCRIPTION=/,EOF' release_info.info | sed '1 s/DESCRIPTION=//' | sed ':a;N;$!ba;s/\n/%0A/g') + echo "::set-output name=version::${VERSION}" + echo "::set-output name=description::${DESCRIPTION}" + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ steps.release_info.outputs.version }} + name: Release ${{ steps.release_info.outputs.version }} + body: ${{ steps.release_info.outputs.description }} + files: target/*.jar + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}