Skip to content

release

release #67

name: Bump Version and Publish to npm
on:
repository_dispatch:
types: [release]
jobs:
bump-version-and-publish:
runs-on: self-hosted
permissions:
packages: write
contents: write
actions: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
- name: Create lib
run: npm run ci
- name: Checkout, bun, commit and push version change
run: |
git config user.name "konstruct-bot"
git config user.email "konstruct-bot@konstruct.io"
git fetch origin main
git checkout main
npm version ${{ github.event.client_payload.version }} --no-commit-hooks --no-git-tag-version
git add package.json package-lock.json
git commit -m "🔖 release: bump version to ${{ github.event.client_payload.version }}" --allow-empty --no-verify
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Authenticate with GitHub Packages
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GH_TOKEN }}" > ~/.npmrc
- name: Authenticate with npmjs
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
- name: Publish to GitHub Packages
run: npm publish --registry https://npm.pkg.github.com/
- name: Publish to npm
run: npm publish --registry https://registry.npmjs.org/
- name: Send new version of the package to Konstruct Slack
run: |
curl --location 'https://n8n-production.mgmt-24.konstruct.io/webhook/konstruct-ui/updates' \
--header 'Content-Type: application/json' \
--data '{
"package_name": "${{ github.event.repository.name }}",
"version": "${{ github.event.client_payload.version }}",
"url": "${{ github.event.client_payload.url }}",
"repository": "${{ github.event.repository.html_url }}",
"storybook": "https://konstructio.github.io/konstruct-ui"
}'