Skip to content

Commit

Permalink
Create automatic releases via GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelderuiter committed Oct 11, 2023
1 parent cacab71 commit 8aad1ac
Show file tree
Hide file tree
Showing 3 changed files with 327 additions and 1,806 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Create a new release and a publish to GitHub Package Registry

on:
workflow_dispatch:
push:
branches:
- 'main'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npm test

publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org

- run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
npm ci && npm run build
npm version patch
git push origin --follow-tags
npm publish
gh release create
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 8aad1ac

Please sign in to comment.