Skip to content
Merged
Show file tree
Hide file tree
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
106 changes: 29 additions & 77 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,89 +1,41 @@
name: Publish package to NPM and Git registry

name: Publish package to npmjs registry
on:
push:
branches:
- main

release:
types: [published]
Comment thread
cs-raj marked this conversation as resolved.
jobs:
build:
name: Build and upload
publish-npm:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
- name: Install dependencies
run: npm install
- name: Build
run: |
rm -rf dist
npm run prepare
- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: dist
path: dist

release:
name: Download dist and release
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org/
cache: 'npm'
- run: npm ci
- name: Update npm
run: npm install -g npm@latest
- name: Release
run: npm publish --access public
publish-github:
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
- name: Install dependencies
run: npm install
- name: Download dist
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Display dirs
run: ls -R
- uses: Klemensas/[email protected]
id: update_tag
with:
GITHUB_TOKEN: "${{ secrets.PKG_TOKEN }}"
tag_prefix: "v"
- name: Release
if: steps.update_tag.outputs.tagname
id: release-plugin
uses: JS-DevTools/[email protected]
with:
token: ${{ secrets.TYPES_GENERATOR_AUTOMATION }}
strategy: upgrade
# setup-node writes an .npmrc pointing at GitHub Packages, so the scoped
# publish below resolves there instead of npmjs.
- name: Setup Node.js for GitHub Packages
if: steps.update_tag.outputs.tagname
uses: actions/setup-node@v4
with:
node-version: "22.x"
node-version: 24
registry-url: https://npm.pkg.github.com/
- name: Release to GitHub Packages
if: steps.update_tag.outputs.tagname
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.PKG_TOKEN }}
- name: GitHub Release
if: steps.update_tag.outputs.tagname
id: github-release
cache: 'npm'
- run: npm ci
- name: Update npm
run: npm install -g npm@latest
Comment thread
cs-raj marked this conversation as resolved.
- name: Release
run: npm publish --access public
env:
GITHUB_TOKEN: ${{ secrets.PKG_TOKEN }}
VERSION: ${{ steps.release-plugin.outputs.version }}
run: gh release create v"$VERSION" --title "Release $VERSION" --generate-notes
NODE_AUTH_TOKEN: ${{ github.token }}
11 changes: 3 additions & 8 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
* @contentstack/devex-pr-reviewers

.github/workflows/sca-scan.yml @contentstack/security-admin

* @contentstack/developer-ecosystem-pr-reviewers
.github/workflows/ @contentstack/security-admin
**/.snyk @contentstack/security-admin

.github/workflows/policy-scan.yml @contentstack/security-admin

.github/workflows/issues-jira.yml @contentstack/security-admin
**/CODEOWNERS @contentstack/security-admin
Loading
Loading