From b481822995fb9254835c6872fb388450d3bfbd7d Mon Sep 17 00:00:00 2001 From: sharansalian Date: Fri, 10 May 2024 11:30:19 +0530 Subject: [PATCH] Update Workflow --- .github/workflows/on_merge_main.yml | 31 ++++++++--------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/.github/workflows/on_merge_main.yml b/.github/workflows/on_merge_main.yml index b13a6c7..3e9d563 100644 --- a/.github/workflows/on_merge_main.yml +++ b/.github/workflows/on_merge_main.yml @@ -1,31 +1,16 @@ -name: Tag and Release on Main Push - on: - push: - branches: - - main + release: + types: [created] jobs: - tag-and-release: + + trigger-jitpack-build: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Set up Git credentials - run: | - git config --local user.email "sharansalian.dev@gmail.com" - git config --local user.name "sharansalian" - - - name: Get commit SHA - id: commit_sha - run: echo "${GITHUB_SHA::8}" # Extracts the first 8 characters of the commit SHA + - name: checkout repository + uses: actions/checkout@v3 - - name: Create Tag and Release + - name: trigger build on jitpack run: | - git tag -a "v${{ steps.commit_sha.outputs.stdout }}" -m "Automated tag creation on main push" - git push origin "v${{ steps.commit_sha.outputs.stdout }}" - hub release create -m "Release v${{ steps.commit_sha.outputs.stdout }}" "v${{ steps.commit_sha.outputs.stdout }}" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + curl --request GET "https://jitpack.io/api/builds/settle-finance/java-integration-sdk/${{ github.event.release.tag_name }}" \ No newline at end of file