Skip to content

Merge pull request #52 from replicatedhq/divolgin/sc-111264/release-n… #20

Merge pull request #52 from replicatedhq/divolgin/sc-111264/release-n…

Merge pull request #52 from replicatedhq/divolgin/sc-111264/release-n… #20

Workflow file for this run

name: Publish Package to npmjs
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set node-version
uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org/'
node-version-file: 'package.json'
- name: Build
run: make build
- name: Test
run: make test
- run: gh release create ${{ github.ref_name }} --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set node-version
uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org/'
node-version-file: 'package.json'
- name: Build
run: make build
- name: set outputs
id: vars
run: |
npm_version=${{ github.ref_name }}
echo "npm_version=${npm_version#v}" >> "$GITHUB_OUTPUT"
- run: npm version --no-commit-hooks --no-git-tag-version ${{ steps.vars.outputs.npm_version }}
- run: make publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}