-
Notifications
You must be signed in to change notification settings - Fork 11
85 lines (82 loc) · 3.18 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Release
on:
push:
branches:
- main
- beta
- next
- '^([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*|x)'
permissions:
contents: read # for checkout
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
outputs:
RELEASE_VERSION: ${{ steps.extract_version.outputs.RELEASE_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.CI_GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- name: Install dependencies
run: npm clean-install
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
if: success()
run: npm audit signatures
- name: Release
if: success()
env:
CI: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN}}
run: npx semantic-release
- name: Extract Version
id: extract_version
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "RELEASE_VERSION=${PACKAGE_VERSION}" >> "$GITHUB_OUTPUT"
- name: Trigger Quill Icons Park release
if: success()
env:
QUILL_ICONS_PARK_WORK_FLOW_FILE: 'pr_to_inform_quill_icons_update.yaml'
run: |
curl \
-X POST \
-H "Authorization: token ${{ secrets.CI_GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{github.repository}}/actions/workflows/$QUILL_ICONS_PARK_WORK_FLOW_FILE/dispatches \
-d '{"ref":"main"}'
send_slack_notification:
name: Send Release Slack notification
runs-on: ubuntu-latest
if: always()
needs: [release]
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Conclusion
uses: technote-space/workflow-conclusion-action@45ce8e0eb155657ab8ccf346ade734257fd196a5
- name: Create Slack Message
id: create_slack_message
run: |
if [ "$WORKFLOW_CONCLUSION" == "success" ]; then
echo "MESSAGE=$RELEASE_TYPE ✅ The release for @deriv/quill-icons was successful, and the new version (${{ needs.release.outputs.RELEASE_VERSION }}) is now available." >> $GITHUB_OUTPUT
else
echo "MESSAGE=$RELEASE_TYPE 🤨 The release attempt for @deriv/quill-icons with version ${{ needs.release.outputs.RELEASE_VERSION }} was unsuccessful." >> $GITHUB_OUTPUT
fi
- name: Send Slack Notification
uses: 'deriv-com/shared-actions/.github/actions/send_slack_notification@master'
with:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MESSAGE: ${{ steps.create_slack_message.outputs.MESSAGE }}