Skip to content

Commit e9e341c

Browse files
committed
fix: fix release script
1 parent 52ac487 commit e9e341c

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

.woodpecker/buildSlackNotify.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ set -x
44

55
COMMIT_SHORT_SHA=$(echo $CI_COMMIT_SHA | cut -c1-8)
66

7+
STATUS=${1}
78

8-
if [ "$CI_PREV_PIPELINE_STATUS" = "success" ]; then
9+
10+
if [ "$STATUS" = "success" ]; then
911
MESSAGE="Did a build without issues on \`$CI_REPO_NAME/$CI_COMMIT_BRANCH\`. Commit: _${CI_COMMIT_MESSAGE}_ (<$CI_COMMIT_URL|$COMMIT_SHORT_SHA>)"
1012

1113
curl -s -X POST -H "Content-Type: application/json" -d '{

.woodpecker/release.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,42 @@ steps:
1616
commands:
1717
- infisical export --domain https://vault.devforth.io/api --format=dotenv-export --env="prod" > /woodpecker/deploy.vault.env
1818

19-
release:
19+
build:
2020
image: node:20
2121
when:
2222
- event: push
2323
commands:
2424
- apt update && apt install -y rsync
25-
- export $(cat /woodpecker/deploy.vault.env | xargs)
25+
- . /woodpecker/deploy.vault.env
2626
- npm clean-install
2727
- /bin/bash ./.woodpecker/buildRelease.sh
2828
- npm audit signatures
29+
30+
release:
31+
image: node:20
32+
when:
33+
- event:
34+
- push
35+
branch:
36+
- main
37+
commands:
38+
- . /woodpecker/deploy.vault.env
2939
- npx semantic-release
3040

3141
slack-on-failure:
42+
image: curlimages/curl
3243
when:
3344
- event: push
34-
status: [failure, success]
35-
- event: push
45+
status: [failure]
46+
commands:
47+
- . /woodpecker/deploy.vault.env
48+
- /bin/sh ./.woodpecker/buildSlackNotify.sh failure
49+
50+
slack-on-success:
3651
image: curlimages/curl
52+
when:
53+
- event: push
54+
status: [success]
3755
commands:
38-
- export $(cat /woodpecker/deploy.vault.env | xargs)
39-
- /bin/sh ./.woodpecker/buildSlackNotify.sh
40-
56+
- . /woodpecker/deploy.vault.env
57+
- /bin/sh ./.woodpecker/buildSlackNotify.sh success

0 commit comments

Comments
 (0)