-
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (73 loc) · 2.25 KB
/
release.yml
File metadata and controls
83 lines (73 loc) · 2.25 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Release
on:
push:
branches:
- master
- release/*
permissions:
packages: write
contents: write
issues: write
pull-requests: write
id-token: write
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Git Bot
run: |
git config --local user.email "contact@notask.com"
git config --local user.name "notask-bot"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- run: npm ci
- run: npm run format
- run: npm test
- name: Build
run: npm run build
- name: Create Dist Archive
shell: bash
run: |
zip -r dist-esm.zip dist/esm
zip -r dist-cjs.zip dist/cjs
- name: Setup Node.js with GitHub Packages
uses: actions/setup-node@v4
with:
node-version: "lts/*"
registry-url: https://registry.npmjs.org/
always-auth: true
- name: Release to npm
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_NAME: "@notask-bot"
GIT_AUTHOR_EMAIL: ${{ secrets.NOTASK_BOT_EMAIL }}
GIT_COMMITTER_NAME: "@notask-bot"
GIT_COMMITTER_EMAIL: ${{ secrets.NOTASK_BOT_EMAIL }}
- name: Setup Node.js with GitHub Packages
uses: actions/setup-node@v4
with:
node-version: "lts/*"
registry-url: https://npm.pkg.github.com/
scope: ${GITHUB_REPOSITORY_OWNER}
always-auth: true
- run: |
echo "@NoTaskStudios:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
npm pkg set name="@${{ github.repository }}"
npm pkg fix
- run: npm publish --access public
env:
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
PACKAGE_NAME: ${{ github.repository }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}