Skip to content

Commit

Permalink
[skip release] Move skip release logic to shell scripts (#37)
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Wilhelm <[email protected]>
  • Loading branch information
devtonhere authored Dec 10, 2024
1 parent ad91aca commit d55d121
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .github/scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash
set -ev

if [[ $(git log -1 --pretty=format:"%s") =~ "[skip release]" ]]; then
echo 'Stopping the script because [skip release] was found in commit message'
exit 0
fi

export GPG_TTY=$(tty)
export SONATYPE_USERNAME=$OSSRH_USERNAME
export SONATYPE_PASSWORD=$OSSRH_PASSWORD
Expand Down
5 changes: 5 additions & 0 deletions .github/scripts/push-tag.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash
set -ev

if [[ $(git log -1 --pretty=format:"%s") =~ "[skip release]" ]]; then
echo 'Stopping the script because [skip release] was found in commit message'
exit 0
fi

# Prepare release
git config user.name "GitHub Action"
git config user.email "[email protected]"
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,21 @@ jobs:
ref: master
fetch-depth: 0

- name: Check Skip Commit
id: checkskip
run: if [[ $(git log -1 --pretty=format:"%s") =~ "[skip release]" ]]; then false; else true; fi
continue-on-error: true

- name: Set up JDK 8
if: steps.checkskip.conclusion == 'success'
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
- name: Cache SBT
if: steps.checkskip.conclusion == 'success'
uses: actions/cache@v3
with:
path: |
~/.ivy2/cache
~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt', 'project/**') }}
- name: Push git tag
if: steps.checkskip.conclusion == 'success'
run: ./.github/scripts/push-tag.sh
- name: Deploy
if: steps.checkskip.conclusion == 'success'
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
Expand Down

0 comments on commit d55d121

Please sign in to comment.