-
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (49 loc) · 1.74 KB
/
pkg-publish.yaml
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
name: oneiros::publish
on:
release:
types: [published]
jobs:
run-build:
name: oneiros::publish::build
runs-on: ubuntu-latest
steps:
- name: oneiros::publish::build::Check out Git repository and Config User
uses: actions/checkout@v4
with:
ref: ${{github.event.release.target_commitish}}
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: oneiros::publish::build::Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 20
- name: oneiros::publish::build::Install Node.js dependencies
run: npm ci
- name: oneiros::publish::build::Build
run: npm run build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run-publish:
name: oneiros::publish::npm-publish
runs-on: ubuntu-latest
needs: run-build
permissions:
contents: write
packages: write
steps:
- name: oneiros::publish::npm-publish::Check out Git repository and Config User
uses: actions/checkout@v3
with:
ref: ${{github.event.release.target_commitish}}
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: oneiros::publish::npm-publish::Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 20
- name: oneiros::publish::npm-publish::Publish Package
run: git checkout -b release/${GITHUB_REF#refs/tags/} && npm version ${GITHUB_REF#refs/tags/} && git push --set-upstream origin release/${GITHUB_REF#refs/tags/} && npm publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}