-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(version): Create a pull request for the release process (#195)
This workflow consists in 2 steps: 1. The create-pre-release-pr.yaml workflow that triggers a lerna-lite version command and creates a pull request with the changes 2. Once the pull request is done, the release-and-publish.yml workflow publish the changed packages by using the lerna-lite publish from-package command and later on it creates a release. The latter is not working due to lack of permissions to create the release.
- Loading branch information
Showing
4 changed files
with
89 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: 🏷️ Release and publish a new version of the package | ||
on: | ||
# Run on pull request merged from a `pre-release` branch into the `main` branch\ | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- main | ||
paths: | ||
- 'packages/**/CHANGELOG.md' | ||
|
||
jobs: | ||
release-and-publish: | ||
permissions: | ||
contents: write | ||
|
||
if: github.event.pull_request.merged == true | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout source code' | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
scope: '@kaoto-next' | ||
cache: 'yarn' | ||
|
||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: 🔧 Install dependencies | ||
run: yarn | ||
|
||
# Build lib | ||
- name: Build @kaoto-next/ui package in lib mode | ||
run: yarn workspace @kaoto-next/ui run build:lib | ||
|
||
# Version and publish | ||
- name: 'Version and publish' | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{ secrets.KAOTO_NEXT_NPM_TOKEN }} | ||
run: yarn publish | ||
|
||
- name: Create Release | ||
uses: ncipollo/[email protected] | ||
with: | ||
draft: true | ||
commit: ${{ github.event.pull_request.head.sha }} | ||
tag: ${{ github.event.pull_request.head.ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters