Skip to content

Commit 313a387

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

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/release.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
permissions:
13+
contents: write
14+
steps:
15+
- name: Checkout the repository
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Install GitVersion
21+
uses: gittools/actions/gitversion/setup@v0
22+
with:
23+
versionSpec: 5.x
24+
25+
- name: Calculate the build version
26+
id: gitversion
27+
uses: gittools/actions/gitversion/execute@v0
28+
with:
29+
useConfigFile: true
30+
31+
- name: Install and configure Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: 18
35+
registry-url: 'https://registry.npmjs.org'
36+
37+
- name: Install pnpm
38+
uses: pnpm/action-setup@v3
39+
with:
40+
version: 8
41+
run_install: true
42+
43+
- name: Increment package version
44+
run: "npm version ${{ steps.gitversion.outputs.semver }} -m 'chore: Bump package version'"
45+
46+
- name: Build
47+
run: pnpm build
48+
49+
- name: Package
50+
run: pnpm package
51+
52+
- name: Publish
53+
run: npm publish --dry-run --provenance --access public
54+
env:
55+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)