Skip to content

Commit 655075d

Browse files
committed
add function purge_artifacts
1 parent d9bce93 commit 655075d

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

.github/functions.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ release_perform() {
139139
find . -type f -name "*-$REVISION.zip" -print0 | xargs -0 gh release -R "$GITHUB_REPOSITORY" create "$TAG" --prerelease --target "$COMMIT_ID"
140140
}
141141

142+
purge_artifacts() {
143+
./mvnw -B --color=always build-helper:remove-project-artifact || :
144+
find ~/.m2/ -type d -name '*-SNAPSHOT' \( -exec rm -rf '{}' \; -prune \)
145+
}
146+
142147
[ $# -eq 0 ] || {
143148
set -e
144149
set -o pipefail

.github/workflows/build.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ jobs:
4949
with:
5050
token: ${{ secrets.CODECOV_TOKEN }}
5151
- name: Before Cache
52-
run: |
53-
./mvnw -B --color=always build-helper:remove-project-artifact || :
54-
find ~/.m2/ -type d -name '*-SNAPSHOT' \( -exec rm -rf '{}' \; -prune \)
52+
run: .github/functions.sh purge_artifacts
5553
deploy:
5654
name: deploy
5755
runs-on: ubuntu-latest
@@ -85,6 +83,4 @@ jobs:
8583
*) printf '\e[31m%s\e[m\n' "skip deploy version '$version'" ;;
8684
esac
8785
- name: Before Cache
88-
run: |
89-
./mvnw -B --color=always build-helper:remove-project-artifact || :
90-
find ~/.m2/ -type d -name '*-SNAPSHOT' \( -exec rm -rf '{}' \; -prune \)
86+
run: .github/functions.sh purge_artifacts

.github/workflows/release.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,4 @@ jobs:
7575
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
7676
run: .github/functions.sh release_perform
7777
- name: Before Cache
78-
run: |
79-
./mvnw -B --color=always build-helper:remove-project-artifact || :
80-
find ~/.m2/ -type d -name '*-SNAPSHOT' \( -exec rm -rf '{}' \; -prune \)
78+
run: .github/functions.sh purge_artifacts

0 commit comments

Comments
 (0)