-
Notifications
You must be signed in to change notification settings - Fork 103
88 lines (78 loc) · 2.75 KB
/
publish.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Publishes a GitHub release and NPM package for
# any tag that is pushed to the repository.
# Tags should be generated automatically by
# manually running the "release" workflow.
name: Publish
on:
push:
branches:
- 13-stable
jobs:
publish:
if: ${{ startsWith(github.event.head_commit.message, 'release:') }}
runs-on: ubuntu-latest
steps:
- uses: extractions/setup-just@v1
- uses: actions/checkout@v4
- name: Extract version number
id: vars
run: echo ::set-output name=version::v$(jq -r .version package.json)
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: yarn
registry-url: 'https://registry.npmjs.org'
- name: Build
env:
CYPRESS_INSTALL_BINARY: 0
run: |
just install
just build
- name: Release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # provided by Actions
with:
tag_name: ${{ steps.vars.outputs.version }}
release_name: Release ${{ steps.vars.outputs.version }}
body_path: CHANGELOG.md
draft: false
prerelease: false
- name: Upload media-stream-library
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: streams/dist/media-stream-library.min.js
asset_name: media-stream-library.min.js
asset_content_type: application/javascript
- name: Upload media-stream-player
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: player/dist/media-stream-player.min.js
asset_name: media-stream-player.min.js
asset_content_type: application/javascript
- name: Upload media-overlay-library
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: overlay/dist/media-overlay-library.min.js
asset_name: media-overlay-library.min.js
asset_content_type: application/javascript
- name: Deploy NPM packages
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: |
if [[ $GITHUB_REF =~ alpha|beta ]]; then
yarn workspaces foreach --no-private npm publish --tag next
else
yarn workspaces foreach --no-private npm publish --tag latest
fi