Skip to content

Commit

Permalink
Added npm publish github action
Browse files Browse the repository at this point in the history
  • Loading branch information
osirisguitar committed May 29, 2024
1 parent 88a0d8f commit 6ce6612
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node

- uses: actions/checkout@v4
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.release_created }}

- name: Read .nvmrc
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
id: nvm

- name: Use Node.js ${{ steps.nvm.outputs.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ steps.nvm.outputs.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}

- name: Install dependencies
run: npm ci
if: ${{ steps.release.outputs.release_created }}

- name: Build
run: npm run build
if: ${{ steps.release.outputs.release_created }}

- name: Publish package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"url": "git+https://github.com/Bostads-AB-Mimer/onecore-utilities.git"
},
"author": "Anders Norrback Bornholm",
"license": "ISC",
"license": "AGPL-3.0-only",
"bugs": {
"url": "https://github.com/Bostads-AB-Mimer/onecore-utilities/issues"
},
Expand Down

0 comments on commit 6ce6612

Please sign in to comment.