Skip to content

Commit 1eb04d2

Browse files
authored
chore(ci): Notify via slack of apps / sdk releases (#109)
Closes #3
1 parent 58ee987 commit 1eb04d2

10 files changed

Lines changed: 229 additions & 15 deletions
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Slack Notify
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
title:
7+
description: "Notification title"
8+
required: true
9+
type: string
10+
message:
11+
description: "Message body (plain text; URLs auto-link)"
12+
required: true
13+
type: string
14+
status:
15+
description: "success or failure (drives icon and color)"
16+
required: false
17+
default: success
18+
type: string
19+
footer:
20+
description: "Optional footer (e.g. commit link)"
21+
required: false
22+
default: ""
23+
type: string
24+
secrets:
25+
CI_SLACK_WEBHOOK:
26+
required: true
27+
28+
jobs:
29+
notify:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: ravsamhq/notify-slack-action@be814b201e233b2dc673608aa46e5447c8ab13f2 # v2.5.0
33+
with:
34+
status: ${{ inputs.status }}
35+
notification_title: ${{ inputs.title }}
36+
message_format: ${{ inputs.message }}
37+
footer: ${{ inputs.footer }}
38+
env:
39+
SLACK_WEBHOOK_URL: ${{ secrets.CI_SLACK_WEBHOOK }}

.github/workflows/apps_apps-backend_deploy.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ jobs:
5757
packages: write
5858
id-token: write
5959

60+
outputs:
61+
version: ${{ steps.commit-hash.outputs.version }}
62+
6063
steps:
6164
- name: Checkout code
6265
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
@@ -72,9 +75,11 @@ jobs:
7275
password: ${{ secrets.GITHUB_TOKEN }}
7376

7477
- name: Get the short commit hash
78+
id: commit-hash
7579
run: |
7680
COMMIT_HASH=$(git rev-parse --short HEAD)
7781
echo "VERSION=$COMMIT_HASH" >> $GITHUB_ENV
82+
echo "version=$COMMIT_HASH" >> $GITHUB_OUTPUT
7883
7984
- name: Build and push Docker image
8085
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
@@ -96,3 +101,17 @@ jobs:
96101
- name: Deploy to Server
97102
run: |
98103
ssh -o StrictHostKeyChecking=no updater@${{ secrets.UPDATER_SSH_HOST }} "${{ needs.resolve-deploy-type.outputs.deploy_type }} ${{ env.VERSION }}"
104+
105+
notify:
106+
needs: [resolve-deploy-type, build-and-deploy]
107+
if: always() && needs.build-and-deploy.result != 'skipped' && (needs.resolve-deploy-type.outputs.deploy_type == 'rc' || needs.resolve-deploy-type.outputs.deploy_type == 'production')
108+
uses: ./.github/workflows/_slack_notify.yml
109+
secrets: inherit
110+
with:
111+
status: ${{ needs.build-and-deploy.result == 'success' && 'success' || 'failure' }}
112+
title: "Apps Backend ${{ needs.resolve-deploy-type.outputs.deploy_type }} deploy ${{ needs.build-and-deploy.result }}"
113+
message: |
114+
Environment: ${{ needs.resolve-deploy-type.outputs.deploy_type }}
115+
Image: ghcr.io/iotaledger/iota/apps-backend-${{ needs.resolve-deploy-type.outputs.deploy_type }}:${{ needs.build-and-deploy.outputs.version }}
116+
Workflow Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
117+

.github/workflows/apps_evm-bridge_deploy.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
deploy_type: ${{ steps.resolve.outputs.deploy_type }}
2828
environment: ${{ steps.resolve.outputs.environment }}
2929
apps_backend_secret: ${{ steps.resolve.outputs.apps_backend_secret }}
30+
mainnet_url: ${{ steps.resolve.outputs.mainnet_url }}
31+
testnet_url: ${{ steps.resolve.outputs.testnet_url }}
3032
steps:
3133
- name: Resolve deploy type
3234
id: resolve
@@ -50,6 +52,14 @@ jobs:
5052
;;
5153
esac
5254
55+
if [ "$DEPLOY_TYPE" = "production" ]; then
56+
echo "mainnet_url=https://evm-bridge.iota.org" >> "$GITHUB_OUTPUT"
57+
echo "testnet_url=https://testnet.evm-bridge.iota.org" >> "$GITHUB_OUTPUT"
58+
else
59+
echo "mainnet_url=https://evm-bridge-${DEPLOY_TYPE}-iota1.vercel.app" >> "$GITHUB_OUTPUT"
60+
echo "testnet_url=https://testnet-evm-bridge-${DEPLOY_TYPE}-iota1.vercel.app" >> "$GITHUB_OUTPUT"
61+
fi
62+
5363
deploy:
5464
needs: resolve-deploy-type
5565
permissions:
@@ -128,3 +138,18 @@ jobs:
128138
129139
vercel alias "$DEPLOY_URL" "${ALIAS_PREFIX}evm-bridge-${DEPLOY_TYPE}-iota1.vercel.app" $VERCEL_FLAGS
130140
fi
141+
142+
notify:
143+
needs: [resolve-deploy-type, deploy]
144+
if: always() && needs.deploy.result != 'skipped' && (needs.resolve-deploy-type.outputs.deploy_type == 'rc' || needs.resolve-deploy-type.outputs.deploy_type == 'production')
145+
uses: ./.github/workflows/_slack_notify.yml
146+
secrets: inherit
147+
with:
148+
status: ${{ needs.deploy.result == 'success' && 'success' || 'failure' }}
149+
title: "EVM Bridge ${{ needs.resolve-deploy-type.outputs.deploy_type }} deploy ${{ needs.deploy.result }}"
150+
message: |
151+
Environment: ${{ needs.resolve-deploy-type.outputs.deploy_type }}
152+
Mainnet URL: ${{ needs.resolve-deploy-type.outputs.mainnet_url }}
153+
Testnet URL: ${{ needs.resolve-deploy-type.outputs.testnet_url }}
154+
Workflow Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
155+

.github/workflows/apps_explorer_deploy.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ jobs:
5252
permissions:
5353
contents: read
5454

55+
outputs:
56+
url: ${{ steps.deploy.outputs.url }}
57+
5558
env:
5659
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
5760
VERCEL_PROJECT_ID: ${{ secrets.EXPLORER_VERCEL_PROJECT_ID }}
@@ -71,6 +74,7 @@ jobs:
7174
- name: Install Vercel CLI
7275
run: pnpm add --global vercel@canary
7376
- name: Pull Vercel Env variables and deploy
77+
id: deploy
7478
run: |
7579
DEPLOY_TYPE="${{ needs.resolve-deploy-type.outputs.deploy_type }}"
7680
VERCEL_FLAGS="--token=${{ secrets.VERCEL_TOKEN }} --scope=${{ secrets.VERCEL_SCOPE }}"
@@ -89,10 +93,29 @@ jobs:
8993
if [ "$DEPLOY_TYPE" = "production" ]; then
9094
vercel build --prod $VERCEL_FLAGS
9195
vercel deploy --prod --prebuilt $VERCEL_FLAGS
96+
PUBLIC_URL="https://explorer.iota.org"
9297
else
9398
vercel build $VERCEL_FLAGS
94-
DEPLOYMENT_URL=$(vercel deploy --prebuilt $VERCEL_FLAGS)
9599
if [ "$DEPLOY_TYPE" = "rc" ]; then
96-
vercel alias set "$DEPLOYMENT_URL" explorer-rc-iota1.vercel.app $VERCEL_FLAGS
100+
vercel alias set "$(vercel deploy --prebuilt $VERCEL_FLAGS)" explorer-rc-iota1.vercel.app $VERCEL_FLAGS
101+
PUBLIC_URL="https://explorer-rc-iota1.vercel.app"
102+
else
103+
PUBLIC_URL=$(vercel deploy --prebuilt $VERCEL_FLAGS)
97104
fi
98105
fi
106+
107+
echo "url=$PUBLIC_URL" >> "$GITHUB_OUTPUT"
108+
109+
notify:
110+
needs: [resolve-deploy-type, deploy]
111+
if: always() && needs.deploy.result != 'skipped' && (needs.resolve-deploy-type.outputs.deploy_type == 'rc' || needs.resolve-deploy-type.outputs.deploy_type == 'production')
112+
uses: ./.github/workflows/_slack_notify.yml
113+
secrets: inherit
114+
with:
115+
status: ${{ needs.deploy.result == 'success' && 'success' || 'failure' }}
116+
title: "Explorer ${{ needs.resolve-deploy-type.outputs.deploy_type }} deploy ${{ needs.deploy.result }}"
117+
message: |
118+
Environment: ${{ needs.resolve-deploy-type.outputs.deploy_type }}
119+
URL: ${{ needs.deploy.outputs.url }}
120+
Workflow Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
121+

.github/workflows/apps_names-display_deploy.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
build-and-deploy:
1414
runs-on: ubuntu-latest
1515
environment: production
16+
outputs:
17+
version: ${{ steps.commit-hash.outputs.version }}
1618
steps:
1719
- name: Checkout code
1820
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -28,9 +30,11 @@ jobs:
2830
password: ${{ secrets.GITHUB_TOKEN }}
2931

3032
- name: Get the short commit hash
33+
id: commit-hash
3134
run: |
3235
COMMIT_HASH=$(git rev-parse --short HEAD)
3336
echo "VERSION=$COMMIT_HASH" >> $GITHUB_ENV
37+
echo "version=$COMMIT_HASH" >> $GITHUB_OUTPUT
3438
3539
- name: Build and push Docker image
3640
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a # v2
@@ -53,3 +57,17 @@ jobs:
5357
if: ${{ github.event.inputs.deployment == 'true' }}
5458
run: |
5559
ssh -o StrictHostKeyChecking=no updater@${{ secrets.UPDATER_SSH_HOST }} "prod ${{ env.VERSION }}"
60+
61+
notify:
62+
needs: build-and-deploy
63+
if: always() && needs.build-and-deploy.result != 'skipped' && github.event.inputs.deployment == 'true'
64+
uses: ./.github/workflows/_slack_notify.yml
65+
secrets: inherit
66+
with:
67+
status: ${{ needs.build-and-deploy.result == 'success' && 'success' || 'failure' }}
68+
title: "Names Display production build ${{ needs.build-and-deploy.result }}"
69+
message: |
70+
Environment: production
71+
Image: ghcr.io/iotaledger/iota-names/iota-names-display:${{ needs.build-and-deploy.outputs.version }}
72+
Workflow Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
73+

.github/workflows/apps_wallet_build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ jobs:
7272
environment: ${{ needs.resolve-deploy-type.outputs.environment }}
7373
permissions:
7474
contents: write
75+
outputs:
76+
artifact_name: ${{ steps.artifact.outputs.artifact_name }}
77+
release_tag: ${{ steps.prev_tag.outputs.current_tag }}
78+
artifact_link: ${{ steps.artifact-link.outputs.artifact_link }}
7579
env:
7680
DEFAULT_NETWORK: ${{ secrets[needs.resolve-deploy-type.outputs.default_network_secret] }}
7781
IOTA_NETWORKS: ${{ secrets[needs.resolve-deploy-type.outputs.iota_networks_secret] }}
@@ -99,6 +103,7 @@ jobs:
99103
with:
100104
path: apps/wallet
101105
- name: Create artifact name
106+
id: artifact
102107
shell: bash
103108
run: |
104109
if [ "$DEPLOY_TYPE" = "rc" ]; then
@@ -107,6 +112,7 @@ jobs:
107112
export artifact_name="iota-wallet-${{ steps.package-version.outputs.current-version }}"
108113
fi
109114
echo "artifact_name=${artifact_name}" >> $GITHUB_ENV
115+
echo "artifact_name=${artifact_name}" >> $GITHUB_OUTPUT
110116
- name: Get Previous Tag
111117
if: env.DEPLOY_TYPE == 'production'
112118
id: prev_tag
@@ -121,6 +127,7 @@ jobs:
121127
echo "PREV_TAG=$prev_tag" >> $GITHUB_ENV
122128
fi
123129
echo "CURRENT_TAG=$current_tag" >> $GITHUB_ENV
130+
echo "current_tag=$current_tag" >> $GITHUB_OUTPUT
124131
- name: Generate Changelog
125132
if: env.DEPLOY_TYPE == 'production'
126133
id: generate_changelog
@@ -174,3 +181,29 @@ jobs:
174181
draft: true
175182
prerelease: false
176183
body_path: CHANGELOG.md
184+
185+
- name: Compose artifact link for Slack
186+
id: artifact-link
187+
if: always()
188+
shell: bash
189+
run: |
190+
if [ "$DEPLOY_TYPE" = "production" ]; then
191+
echo "artifact_link=Release: ${{ github.server_url }}/${{ github.repository }}/releases/tag/${CURRENT_TAG}" >> "$GITHUB_OUTPUT"
192+
else
193+
echo "artifact_link=Artifacts: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts" >> "$GITHUB_OUTPUT"
194+
fi
195+
196+
notify:
197+
needs: [resolve-deploy-type, wallet-build]
198+
if: always() && needs.wallet-build.result != 'skipped' && (needs.resolve-deploy-type.outputs.deploy_type == 'rc' || needs.resolve-deploy-type.outputs.deploy_type == 'production')
199+
uses: ./.github/workflows/_slack_notify.yml
200+
secrets: inherit
201+
with:
202+
status: ${{ needs.wallet-build.result == 'success' && 'success' || 'failure' }}
203+
title: "Wallet ${{ needs.resolve-deploy-type.outputs.deploy_type }} build ${{ needs.wallet-build.result }}"
204+
message: |
205+
Environment: ${{ needs.resolve-deploy-type.outputs.deploy_type }}
206+
Artifact: ${{ needs.wallet-build.outputs.artifact_name }}
207+
${{ needs.wallet-build.outputs.artifact_link }}
208+
Workflow Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
209+

.github/workflows/apps_wallet_dashboard_deploy.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ jobs:
4747
environment: ${{ needs.resolve-deploy-type.outputs.environment }}
4848
permissions:
4949
contents: read
50+
outputs:
51+
url: ${{ steps.deploy.outputs.url }}
5052
env:
5153
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
5254
VERCEL_PROJECT_ID: ${{ secrets.WALLET_DASHBOARD_VERCEL_PROJECT_ID }}
@@ -65,6 +67,7 @@ jobs:
6567
- name: Install Vercel CLI
6668
run: pnpm add --global vercel@canary
6769
- name: Pull Vercel Environment and Deploy
70+
id: deploy
6871
run: |
6972
DEPLOY_TYPE="${{ needs.resolve-deploy-type.outputs.deploy_type }}"
7073
VERCEL_FLAGS="--token=${{ secrets.VERCEL_TOKEN }} --scope=${{ secrets.VERCEL_SCOPE }}"
@@ -83,11 +86,29 @@ jobs:
8386
if [ "$DEPLOY_TYPE" = "production" ]; then
8487
vercel build --prod $VERCEL_FLAGS
8588
vercel deploy --prod --prebuilt $VERCEL_FLAGS
89+
PUBLIC_URL="https://wallet-dashboard.iota.org"
8690
else
8791
vercel build $VERCEL_FLAGS
88-
DEPLOY_URL=$(vercel deploy --prebuilt $VERCEL_FLAGS)
89-
9092
if [ "$DEPLOY_TYPE" = "rc" ]; then
91-
vercel alias "$DEPLOY_URL" wallet-dashboard-rc-iota1.vercel.app $VERCEL_FLAGS
93+
vercel alias "$(vercel deploy --prebuilt $VERCEL_FLAGS)" wallet-dashboard-rc-iota1.vercel.app $VERCEL_FLAGS
94+
PUBLIC_URL="https://wallet-dashboard-rc-iota1.vercel.app"
95+
else
96+
PUBLIC_URL=$(vercel deploy --prebuilt $VERCEL_FLAGS)
9297
fi
9398
fi
99+
100+
echo "url=$PUBLIC_URL" >> "$GITHUB_OUTPUT"
101+
102+
notify:
103+
needs: [resolve-deploy-type, deploy]
104+
if: always() && needs.deploy.result != 'skipped' && (needs.resolve-deploy-type.outputs.deploy_type == 'rc' || needs.resolve-deploy-type.outputs.deploy_type == 'production')
105+
uses: ./.github/workflows/_slack_notify.yml
106+
secrets: inherit
107+
with:
108+
status: ${{ needs.deploy.result == 'success' && 'success' || 'failure' }}
109+
title: "Wallet Dashboard ${{ needs.resolve-deploy-type.outputs.deploy_type }} deploy ${{ needs.deploy.result }}"
110+
message: |
111+
Environment: ${{ needs.resolve-deploy-type.outputs.deploy_type }}
112+
URL: ${{ needs.deploy.outputs.url }}
113+
Workflow Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
114+

.github/workflows/changesets_publish.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,17 @@ jobs:
126126
if: github.event.inputs.release_type == 'latest'
127127
uses: ./.github/workflows/ts_sdk_typedoc_upload.yml
128128
secrets: inherit
129+
130+
notify:
131+
needs: publish
132+
if: always() && needs.publish.result != 'skipped' && github.event.inputs.release_type != 'experimental'
133+
uses: ./.github/workflows/_slack_notify.yml
134+
secrets: inherit
135+
with:
136+
status: ${{ needs.publish.result == 'success' && 'success' || 'failure' }}
137+
title: "NPM publish (${{ github.event.inputs.release_type }}) ${{ needs.publish.result }}"
138+
message: |
139+
Release type: ${{ github.event.inputs.release_type }}
140+
@iota/iota-sdk: https://www.npmjs.com/package/@iota/iota-sdk
141+
@iota/dapp-kit: https://www.npmjs.com/package/@iota/dapp-kit
142+
Workflow Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

.github/workflows/ci_slack_report.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@ on:
77

88
jobs:
99
on-failure:
10-
runs-on: ubuntu-latest
1110
if: github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'timed_out'
12-
steps:
13-
- uses: ravsamhq/notify-slack-action@be814b201e233b2dc673608aa46e5447c8ab13f2 # v2.5.0
14-
with:
15-
status: ${{ github.event.workflow_run.conclusion }}
16-
notification_title: " ${{github.event.workflow_run.name}} - ${{github.event.workflow_run.conclusion}} on ${{github.event.workflow_run.head_branch}}"
17-
message_format: ":fire: *${{github.event.workflow_run.name}}* ${{github.event.workflow_run.conclusion}} <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure> author: ${{ github.event.workflow_run.head_commit.author.name }}"
18-
footer: "${{ github.event.workflow_run.display_title }} \n<${{github.server_url}}/${{github.repository}}/commit/${{github.event.workflow_run.head_commit.id}}>"
19-
env:
20-
SLACK_WEBHOOK_URL: ${{ secrets.CI_SLACK_WEBHOOK }}
11+
uses: ./.github/workflows/_slack_notify.yml
12+
secrets: inherit
13+
with:
14+
status: failure
15+
title: "${{ github.event.workflow_run.name }} ${{ github.event.workflow_run.conclusion }} on ${{ github.event.workflow_run.head_branch }}"
16+
message: ":fire: ${{ github.event.workflow_run.name }} ${{ github.event.workflow_run.conclusion }}. Author: ${{ github.event.workflow_run.head_commit.author.name }}. View failure: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}"
17+
footer: "${{ github.event.workflow_run.display_title }} ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.event.workflow_run.head_commit.id }}"

0 commit comments

Comments
 (0)