Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish packages after manually updated version #851

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 19 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
name: Publish NPM package

on:
workflow_dispatch:
inputs:
version:
type: choice
required: true
description: Bump version
options:
- patch
- minor
- major
release:
types:
- published

jobs:
build:
name: Build & Publish NPM package
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Get sources
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}

- uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'

- name: Run npm install - root
run: npm install --no-audit --no-fund
Expand All @@ -38,16 +36,14 @@ jobs:
working-directory: packages/devextreme-schematics
run: npm run build

- uses: fregante/setup-git-user@v2

- name: Update NPM config
run: npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
- name: Publish to NPM devextreme-cli package
working-directory: packages/devextreme-cli
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish

- name: Publish package
- name: Publish to NPM devextreme-schematics package
working-directory: packages/devextreme-schematics
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npx lerna version ${{ github.event.inputs.version }} -y --no-push
git push -f --follow-tags --no-verify --atomic origin master
npx lerna publish from-git -y
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish