-
Notifications
You must be signed in to change notification settings - Fork 118
49 lines (44 loc) · 1.36 KB
/
publish-library-to-npm.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
name: Publish frontend lib
on:
workflow_dispatch:
push:
branches: ['UE5.5']
paths: ['Frontend/library/package.json']
env:
NODE_VERSION: 18.17.x
jobs:
build:
if: github.repository == 'EpicGamesExt/PixelStreamingInfrastructure'
runs-on: ubuntu-latest
defaults:
run:
working-directory: Frontend/library
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: 'Frontend/library'
sparse-checkout-cone-mode: false
- uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- id: get-package-json
run: |
package_content=`cat package.json`
echo "json<<EOF" >> $GITHUB_OUTPUT
echo $package_content >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- uses: actions/github-script@v5
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/lib-frontend-${{ fromJson(steps.get-package-json.outputs.json).version }}',
sha: context.sha
})