-
Notifications
You must be signed in to change notification settings - Fork 12
73 lines (68 loc) · 2.52 KB
/
release.yml
File metadata and controls
73 lines (68 loc) · 2.52 KB
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
# This workflows will build, test and upload the package to npm when a release
# is created.
# To create a release, please follow the steps documented in the "Build &
# Publish" section of the README.md file.
name: Upload Package
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
permissions:
contents: read
jobs:
test:
uses: ./.github/workflows/end-to-end-tests.yml
publish:
runs-on: ubuntu-latest
needs: test
permissions:
contents: write # for GitHub release
id-token: write # for Trusted Publishing to npmjs
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Stop early if the tag fails any validation
run: sh validate-version.sh ${GITHUB_REF_NAME}
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v6
with:
node-version: 24
registry-url: "https://registry.npmjs.org"
scope: "@readalongs"
package-manager-cache: false
- name: Update npm to latest version for OIDC/Trusted Publishing support
run: npm install -g npm@latest
- run: npm ci
- run: npx update-browserslist-db@latest
- name: Build and bundle
run: |
npx nx bundle web-component
npx nx build ngx-web-component
- name: Fix the relative URLs in the READMEs to work on npmjs
run: |
sed -i 's/(\.\.\/web-component)/(web-component)/g' dist/packages/ngx-web-component/README.md
sed -i 's/(test-data\//(https:\/\/github.com\/ReadAlongs\/Studio-Web\/blob\/${GITHUB_REF_NAME}\/packages\/web-component\/test-data\//g' dist/packages/web-component/README.md
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@b78a3354a01f4a1affb484b9264b506a815c46b1 # v1.10.3
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}
- name: Create a GitHub release
uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0
with:
tag: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.changes }}
- name: Publish web-component to npmjs
run: |
cd dist/packages/web-component && npm publish --access=public
- name: Publish ngx-web-component to npmjs
run: |
cd dist/packages/ngx-web-component && npm publish --access=public
deploy:
needs: publish
permissions:
contents: write
uses: ./.github/workflows/deploy.yml