Skip to content

Commit

Permalink
ci: github release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
phette23 committed Sep 21, 2024
1 parent 77c6a30 commit 6f60452
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: GitHub Release & NPM Publish

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
install:
name: Install equella-cli
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
# Sets up .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci

github-release:
name: Create GitHub Release 🚀
needs:
- install
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--generate-notes
npm-publish:
name: Publish to NPM 📦
needs:
- install
runs-on: ubuntu-latest
steps:
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 6f60452

Please sign in to comment.