Skip to content

Commit

Permalink
auto publish GitHub release when new tag pushed.
Browse files Browse the repository at this point in the history
  • Loading branch information
stepanvalyavskiy committed Mar 26, 2024
1 parent 423539e commit 510f6a9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/github-actions-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Has to be published?
id: is-release
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
if: startsWith(github.ref, 'refs/tags/v')
run: |
version="$GITHUB_REF_NAME"
version_number="${version:1}"
Expand All @@ -39,23 +39,23 @@ jobs:
echo "VERSION_NUMBER=$version_number" >> $GITHUB_OUTPUT
- name: Assembles a plugin and prepares ZIP archive for deployment
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
if: startsWith(github.ref, 'refs/tags/v')
run: ./gradlew buildPlugin

- name: Check version
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
if: startsWith(github.ref, 'refs/tags/v')
run: |
if [ ! -f "${{steps.is-release.outputs.ZIP_PATH}}" ]; then
echo "Error: Wrong release version! Check if your tag matches with an actual version in build.gradle.kts"
echo "provided tag's version: ${{ steps.is-release.outputs.VERSION_NUMBER }}"
echo "${{ steps.is-release.outputs.ZIP_PATH }} file expected to be generated"
echo "${{ steps.is-release.outputs.ZIP_PATH }} expected to be generated"
echo "but actual was:"
ls ./build/distributions
exit 1
fi
- name: Publish GitHub Release
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.is-release.outputs.ZIP_PATH }}
Expand Down

0 comments on commit 510f6a9

Please sign in to comment.