1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/.github/workflows/publish-release-npm.yml
Sebastian Malton e89ac54cd3
Fix release process in light of changing to independent versioning (#7357)
* Remove workflow

- Not applicable anymore since each package has its own version

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix daily-alpha to be based on core version

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* lerna.json no longer will be updated during releases

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Use the prerelease parts of @k8slens/core to determine dist tag

Signed-off-by: Sebastian Malton <sebastian@malton.name>

---------

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-03-14 14:56:53 -04:00

52 lines
1.3 KiB
YAML

name: Publish NPM Package Release
on:
workflow_call:
inputs:
version:
required: true
type: string
workflow_dispatch:
inputs:
version:
required: true
type: string
description: The version to release manually
jobs:
publish-npm-packages:
name: Publish NPM Packages
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checkout Release
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ inputs.version }}
- name: Using Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Generate NPM packages
run: |
npm ci
npm run build
- name: Publish NPM packages
run: |
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
VERSION=$(cat packages/core/package.json | jq '.version' --raw-output)
echo ${VERSION}
DIST_TAG=$(node packages/semver/dist/index.js --prerelease 0 ${VERSION})
npx lerna \
publish from-package \
--no-push \
--no-git-tag-version \
--yes \
--dist-tag ${DIST_TAG:-latest}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}