-
Notifications
You must be signed in to change notification settings - Fork 273
68 lines (53 loc) · 1.87 KB
/
publish.yml
File metadata and controls
68 lines (53 loc) · 1.87 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 Release
on: [workflow_dispatch]
jobs:
# Ensure the code is in a releasable state before attempting to publish.
validate:
name: Validate Release Readiness
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: Setup Node.js 22.x
uses: actions/setup-node@v6
with:
node-version: 22.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Lint Code with ESLint
run: npm run lint
- name: Check Code Formatting with Prettier
run: npm run format:check
- name: Validate TypeScript Types
run: npm run validate-types
# Publish the release to the public NPM registry and the private FontAwesome Pro registry.
publish-packages:
name: Publish to Public NPM Registry
runs-on: ubuntu-latest
needs: validate
env:
NPM_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
CLOUDSMITH_TOKEN: ${{ secrets.CLOUDSMITH_PUBLISH_TOKEN }}
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: Setup Node.js 22.x
uses: actions/setup-node@v6
with:
node-version: 22.x
registry-url: 'https://registry.npmjs.org/'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build Package
run: npm run build
- name: Run semantic-release
run: npx semantic-release
- name: Publish Release on NPM
run: npm publish --tag latest --registry=https://registry.npmjs.org/
- name: Authenticate with FontAwesome Pro Registry
run: echo "//npm.fontawesome.com/:_authToken=${CLOUDSMITH_TOKEN}" > ./.npmrc
- name: Publish Release on FontAwesome Pro Registry
run: npm publish --tag latest --registry=https://npm.fontawesome.com/