Skip to content

Commit 2c729ca

Browse files
author
Richard P. Field III
committed
ci: Set up the GitHub actions
1 parent 25985f9 commit 2c729ca

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/release.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Package Release
2+
3+
on:
4+
push:
5+
branches:
6+
- github-action
7+
8+
jobs:
9+
npm-package:
10+
name: Build and push npm package
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout the repository
14+
uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Install GitVersion
19+
uses: gittools/actions/gitversion/setup@v0
20+
with:
21+
versionSpec: 5.x
22+
23+
- name: Calculate the build version
24+
id: gitversion
25+
uses: gittools/actions/gitversion/execute@v0
26+
with:
27+
useConfigFile: true
28+
29+
- name: Install and configure Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 18
33+
registry-url: 'https://registry.npmjs.org'
34+
35+
- name: Install pnpm
36+
uses: pnpm/action-setup@v3
37+
with:
38+
version: 8
39+
run_install: true
40+
41+
- name: Build
42+
run: pnpm build
43+
44+
- name: Package
45+
run: pnpm package
46+
47+
- name: Publish
48+
run: npm publish --dry-run --provenance --access public --tag ${{ steps.gitversion.outputs.semver }}
49+
env:
50+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)