-
-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (52 loc) · 1.66 KB
/
Copy pathpublish-to-github-packages.yml
File metadata and controls
68 lines (52 loc) · 1.66 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
name: Publish to GitHub Packages
on:
release:
types: [published]
env:
node-version: 22.x
working-directory: ./code
jobs:
test:
name: Run type checking & tests
runs-on: ubuntu-latest
concurrency:
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
cancel-in-progress: true
steps:
- name: Checkout the Git repository
uses: actions/checkout@v5
- name: Use Node.js ${{ env.node-version }}
uses: ./.github/actions/setup-node
with:
node-version: ${{ env.node-version }}
- name: Install Node modules
uses: ./.github/actions/install-node-modules
- name: Run tests (Vitest)
uses: ./.github/actions/run-tests
build:
name: Build & publish package
runs-on: ubuntu-latest
needs: test
concurrency:
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
cancel-in-progress: true
permissions:
contents: read
packages: write
steps:
- name: Checkout the Git repository
uses: actions/checkout@v5
- name: Use Node.js ${{ env.node-version }}
uses: ./.github/actions/setup-node
with:
node-version: ${{ env.node-version }}
registry-url: 'https://npm.pkg.github.com/'
scope: '@wolfpackthatcodes'
- name: Install Node modules
uses: ./.github/actions/install-node-modules
- name: Build npm package
uses: ./.github/actions/build-npm-package
- name: Publish the package to GitHub Packages
uses: ./.github/actions/publish-npm-package
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}