diff --git a/.github/workflows/publish-library.yml b/.github/workflows/publish-library.yml index 280fa37..87365e5 100644 --- a/.github/workflows/publish-library.yml +++ b/.github/workflows/publish-library.yml @@ -1,16 +1,43 @@ name: Publish Library on: - push: - tags: - - 'v*.*.*' + workflow_dispatch: jobs: - publish: + check_environment: + name: Check Environment + runs-on: ubuntu-latest + steps: + - name: Check if Running on develop + run: | + if [[ "${{ github.ref }}" != "refs/heads/master" ]]; then + echo "This workflow can only be run on the master branch. Exiting." + exit 1 + fi + + - name: Check Authorized User + run: | + if [[ "${{ github.actor }}" != "F4bioo" ]]; then + echo "Unauthorized user. Exiting." + exit 1 + fi + + + maven-publish: + needs: check_environment + name: Maven Publish runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: master + token: ${{ secrets.MY_GH_TOKEN }} + + - name: Pull Latest Changes From master + run: | + git pull --rebase origin master - name: Cache Gradle dependencies uses: actions/cache@v2 diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 4d0bece..31a392c 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -175,6 +175,9 @@ jobs: mv lib-build-artifacts.zip ../lib-build-artifacts shell: bash + - name: List LIB Build Artifacts Folder + run: ls -l lib-build-artifacts + - name: Upload LIB Build Artifacts uses: actions/upload-artifact@v3 with: @@ -283,7 +286,7 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: lib-build-artifacts/lib-build-artifacts.zip - asset_name: tourtip-v${{ env.RELEASE_TAG }}.zip + asset_name: tourtip-library-v${{ env.RELEASE_TAG }}-artifacts.zip asset_content_type: application/zip - name: Delete Release Artifacts