-
Notifications
You must be signed in to change notification settings - Fork 23
72 lines (65 loc) · 2.87 KB
/
release.yml
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
name: 🚀 Release
on:
push:
branches:
- master
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Release PR
uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.BOT_TOKEN }}
release-type: node
default-branch: ${{ github.ref_name }}
# The logic below handles the npm publication:
- uses: actions/checkout@v4
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}
- run: npm ci
if: ${{ steps.release.outputs.release_created }}
- run: npm run build-all
if: ${{ steps.release.outputs.release_created }}
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}
- name: Set Notification Messages
if: steps.release.outputs.release_created
id: set-messages
run: |
if [[ ${{ job.status }} == "success" ]]; then
echo "SLACK_TITLE=Video Player ${{ steps.release.outputs.tag_name }} Deployed" >> $GITHUB_OUTPUT
echo "SLACK_MESSAGE=Success :rocket: cloudinary-video-player version ${{ steps.release.outputs.tag_name }} deployed successfully" >> $GITHUB_OUTPUT
echo "SLACK_FOOTER=Check it out at https://cloudinary.github.io/cloudinary-video-player/?ver=latest&min=true" >> $GITHUB_OUTPUT
else
echo "SLACK_TITLE=Video Player Deployment Failed" >> $GITHUB_OUTPUT
echo "SLACK_MESSAGE=:alert: Failed to deploy cloudinary-video-player version ${{ steps.release.outputs.tag_name }}" >> $GITHUB_OUTPUT
echo "SLACK_FOOTER=See log here https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${{ github.job }}" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Slack Notification
if: steps.release.outputs.release_created
uses: rtCamp/[email protected]
env:
SLACK_WEBHOOK: ${{ vars.FE_DEPLOYMENTS_SLACK_WEBHOOK }}
SLACK_CHANNEL: 'rnd-fe-releases'
SLACK_COLOR: ${{ job.status }}
SLACK_TITLE: ${{ steps.set-messages.outputs.SLACK_TITLE }}
SLACK_MESSAGE: ${{ steps.set-messages.outputs.SLACK_MESSAGE }}
SLACK_FOOTER: ${{ steps.set-messages.outputs.SLACK_FOOTER }}
- uses: gacts/purge-jsdelivr-cache@v1
if: steps.release.outputs.release_created
with:
url: |
https://cdn.jsdelivr.net/npm/cloudinary-video-player
https://cdn.jsdelivr.net/npm/cloudinary-video-player@edge