Skip to content

Commit

Permalink
feat(versioning): Version and publish workflow
Browse files Browse the repository at this point in the history
The `trigger-release.yml` workflow, execute a lerna-lite publish command
which calculate the packages versions, publish them to the npmjs registry,
pushes tags and lastly create GitHub releases for each package.

This commit also changes the `repository` to point to the root repository
URL and `repositoryDirectory` to the actual folder of each package to avoid
problems while generating the release notes.
  • Loading branch information
lordrip committed Oct 4, 2023
1 parent 9de45fa commit 98f9587
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
name: 📦 Version and publish npm Package
name: 🏷️ Trigger Version and publish npm Package
# Event for the workflow
on:
workflow_dispatch:
permissions:
contents: write

# Allow one concurrent deployment
concurrency:
group: "publish"
cancel-in-progress: true

jobs:
build-and-deploy:
trigger-version-and-publish:
if: github.repository == 'KaotoIO/kaoto-next' && github.actor != 'renovate[bot]'

permissions:
contents: write

runs-on: ubuntu-latest
steps:
- name: 'Checkout source code'
Expand Down Expand Up @@ -42,13 +45,14 @@ jobs:
- name: Build @kaoto-next/ui package in lib mode
run: yarn workspace @kaoto-next/ui run build:lib

- name: Git user config
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Version and publish
- name: "Version and publish"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.KAOTO_NEXT_NPM_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
yarn publish
run: yarn publish
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "kaoto-next",
"version": "0.0.0",
"description": "Next version of the UI of the Kaoto project",
"repository": "git@github.com:KaotoIO/kaoto-next.git",
"repository": "https://github.com/KaotoIO/kaoto-next",
"author": "The Kaoto Team",
"license": "Apache License v2.0",
"workspaces": [
Expand Down
3 changes: 2 additions & 1 deletion packages/camel-catalog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "0.0.0",
"type": "commonjs",
"description": "Camel Catalog and schemas for Kaoto",
"repository": "[email protected]:KaotoIO/kaoto-next.git",
"repository": "https://github.com/KaotoIO/kaoto-next",
"repositoryDirectory": "packages/camel-catalog",
"author": "The Kaoto Team",
"license": "Apache License v2.0",
"private": true,
Expand Down
6 changes: 2 additions & 4 deletions packages/ui-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
"version": "0.0.0",
"type": "module",
"description": "Kaoto UI tests and storybook",
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/KaotoIO/kaoto-next.git"
},
"repository": "https://github.com/KaotoIO/kaoto-next",
"repositoryDirectory": "packages/ui-tests",
"author": {
"name": "The Kaoto Team"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "0.0.0",
"type": "module",
"description": "Kaoto UI",
"repository": "[email protected]:KaotoIO/kaoto-next.git",
"repository": "https://github.com/KaotoIO/kaoto-next",
"repositoryDirectory": "packages/ui",
"author": "The Kaoto Team",
"license": "Apache License v2.0",
"types": "./lib/esm/public-api.d.ts",
Expand Down

0 comments on commit 98f9587

Please sign in to comment.