diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 125e0117..ea30ce30 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,7 +46,7 @@ jobs: env: GPG_KEY_RING: ${{ secrets.GPG_KEY_RING }} GPG_KEY_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }} - if: github.repository == 'charleskorn/kaml' && github.ref == 'refs/heads/main' && github.event_name == 'push' + if: github.repository == 'charleskorn/kaml' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push' - name: Publish snapshot run: ./batect publishSnapshot @@ -56,6 +56,14 @@ jobs: GPG_KEY_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }} if: github.repository == 'charleskorn/kaml' && github.ref == 'refs/heads/main' && github.event_name == 'push' + - name: Publish release + run: ./batect publishRelease + env: + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + GPG_KEY_RING: ${{ secrets.GPG_KEY_RING }} + GPG_KEY_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }} + if: github.repository == 'charleskorn/kaml' && startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' + - name: Create GitHub release uses: softprops/action-gh-release@v1 with: @@ -66,14 +74,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} if: github.repository == 'charleskorn/kaml' && startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' - - name: Publish release - run: ./batect publishRelease - env: - OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - GPG_KEY_RING: ${{ secrets.GPG_KEY_RING }} - GPG_KEY_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }} - if: github.repository == 'charleskorn/kaml' && startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' - - name: Stop Gradle daemon run: ./gradlew --stop