-
-
Notifications
You must be signed in to change notification settings - Fork 28
50 lines (43 loc) · 1.33 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
name: release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
workflow_dispatch:
inputs:
reason:
description: Why was the workflow triggered manually?
required: true
type: string
permissions:
contents: read
packages: write
id-token: write
jobs:
publish-to-github:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js and install NPM dependencies
uses: ./.github/actions/install-npm-deps
with:
node-version: 'lts/*'
registry-url: 'https://npm.pkg.github.com'
- name: Build library
run: npm run build:lib
- name: Copy license and readme files
run: |
cp LICENSE dist/ng-in-viewport/LICENSE
cp README.md dist/ng-in-viewport/README.md
- name: Publish library package
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd dist/ng-in-viewport
jq '.name="@k3nsei/ng-in-viewport"' ./package.json > /tmp/package.json
mv /tmp/package.json ./package.json
jq 'del(.publishConfig)' ./package.json > /tmp/package.json
mv /tmp/package.json ./package.json
cat ./package.json
npm publish --registry="https://npm.pkg.github.com" --scope="@k3nsei"