Skip to content

Commit

Permalink
ci: Set up the GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rpf3 committed May 1, 2024
1 parent 1454bdc commit 43c11b7
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Package Release

on:
push:
branches:
- main

jobs:
npm-package:
name: Build and push npm package
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: 5.x

- name: Calculate the build version
id: gitversion
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true

- name: Install and configure Node.js
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8
run_install: true

- name: Increment package version
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
npm version ${{ steps.gitversion.outputs.semver }} -m "chore: Bump package version"
git push
- name: Build
run: pnpm build

- name: Package
run: pnpm package

- name: Publish
run: npm publish --dry-run --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 43c11b7

Please sign in to comment.