-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only try to publish a release if a new release was created.
- Loading branch information
1 parent
fd0a1b2
commit 3b2b119
Showing
1 changed file
with
13 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,12 +115,22 @@ jobs: | |
- name: Build | ||
run: ./gradlew assemble | ||
|
||
- name: Get tag | ||
id: get_tag | ||
run: | | ||
if git describe --tags --abbrev=0 --exact-match >/dev/null; then | ||
echo "tag=$(git describe --tags --abbrev=0 --exact-match)" >> $GITHUB_OUTPUT | ||
else | ||
echo "skip=true" >> $GITHUB_OUTPUT | ||
fi | ||
if: github.repository == 'charleskorn/kaml' && github.ref == 'refs/heads/main' && github.event_name == 'push' | ||
|
||
- name: Assemble release | ||
run: ./gradlew assembleRelease | ||
env: | ||
GPG_KEY_RING: ${{ secrets.GPG_KEY_RING }} # Run `gpg --export-secret-keys "<key user name goes here>" | base64` to get this | ||
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' && github.event_name == 'push' && steps.get_tag.outputs.skip != 'true' | ||
|
||
- name: Publish release | ||
run: ./gradlew publishRelease | ||
|
@@ -129,12 +139,7 @@ jobs: | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | ||
GPG_KEY_RING: ${{ secrets.GPG_KEY_RING }} # Run `gpg --export-secret-keys "<key user name goes here>" | base64` to get this | ||
GPG_KEY_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }} | ||
if: github.repository == 'charleskorn/kaml' && github.ref == 'refs/heads/main' && github.event_name == 'push' | ||
|
||
- name: Get tag | ||
id: get_tag | ||
run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT | ||
if: github.repository == 'charleskorn/kaml' && github.ref == 'refs/heads/main' && github.event_name == 'push' | ||
if: github.repository == 'charleskorn/kaml' && github.ref == 'refs/heads/main' && github.event_name == 'push' && steps.get_tag.outputs.skip != 'true' | ||
|
||
- name: Add artifacts to GitHub release | ||
uses: softprops/[email protected] | ||
|
@@ -145,4 +150,4 @@ jobs: | |
draft: true # Update draft release with matching tag, if there is one. | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: github.repository == 'charleskorn/kaml' && github.ref == 'refs/heads/main' && github.event_name == 'push' | ||
if: github.repository == 'charleskorn/kaml' && github.ref == 'refs/heads/main' && github.event_name == 'push' && steps.get_tag.outputs.skip != 'true' |