-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 1.86 KB
/
package.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
name: Build ts-git-info Package
# Github documentation for publishing packages to Github Package Registry can be found here:
# https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-github-packages
# Automatic token authentication and using the GITHUB_TOKEN in a workflow:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication
# Example workflow for publishing a Node.js package:
# https://github.com/github-packages-examples/npm-publish/blob/master/.github/workflows/publish.yml
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: ${{ github.repository_owner }}
- name: Print working directory
run: pwd
- name: Install pnpm
run: npm install -g [email protected]
- name: Install dependencies
run: pnpm install
working-directory: ./src
- name: Build Package
run: |
whoami
pwd
pnpm build
working-directory: ./src
- name: Prepare for publishing
run: |
echo "@RimuTec:registry=https://npm.pkg.github.com" > .npmrc
- name: Publish
run: |
cat /home/runner/work/_temp/.npmrc
npm publish
working-directory: ./src
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The following is NOT in the Github documentation but is required to make this work:
NPM_CONFIG_REGISTRY: 'https://npm.pkg.github.com/RimuTec'