Skip to content

Commit 43c11b7

Browse files
author
Richard P. Field III
committed
ci: Set up the GitHub actions
1 parent 1454bdc commit 43c11b7

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/release.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Package Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
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: |
45+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
46+
git config --global user.name "github-actions[bot]"
47+
npm version ${{ steps.gitversion.outputs.semver }} -m "chore: Bump package version"
48+
git push
49+
50+
- name: Build
51+
run: pnpm build
52+
53+
- name: Package
54+
run: pnpm package
55+
56+
- name: Publish
57+
run: npm publish --dry-run --provenance --access public
58+
env:
59+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)