-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca0b880
commit 9cabe4b
Showing
18 changed files
with
657 additions
and
390 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -9,6 +9,8 @@ on: | |
- labeled | ||
branches: | ||
- main | ||
- alpha | ||
- beta | ||
|
||
# Allow calling manually from GitHub | ||
workflow_dispatch: | ||
|
@@ -52,57 +54,57 @@ jobs: | |
- name: Test | ||
run: pnpm run test | ||
|
||
# - name: Publish package preview | ||
# id: package-preview | ||
# # Do not run for `alpha` or `beta` branches | ||
# if: github.event_name == 'pull_request' && (github.actor != 'renovate[bot]' || contains(github.event.pull_request.labels.*.name, 'create preview package')) | ||
# env: | ||
# NPM_TOKEN: ${{ secrets.NPM_TOKEN_PUBLIC_PUBLISH }} | ||
# run: | | ||
# git config user.email "[email protected]" | ||
# git config user.name "Kong UI Bot" | ||
- name: Publish package preview | ||
id: package-preview | ||
# Do not run for `alpha` or `beta` branches | ||
if: github.event_name == 'pull_request' && (github.actor != 'renovate[bot]' || contains(github.event.pull_request.labels.*.name, 'create preview package')) | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN_PUBLIC_PUBLISH }} | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "Kong UI Bot" | ||
# preid="pr.${{ github.event.pull_request.number }}.$(git rev-parse --short ${{ github.event.pull_request.head.sha }})" | ||
# tag="pr-${{ github.event.pull_request.number }}" | ||
# echo "preid=${preid}" | ||
preid="pr.${{ github.event.pull_request.number }}.$(git rev-parse --short ${{ github.event.pull_request.head.sha }})" | ||
tag="pr-${{ github.event.pull_request.number }}" | ||
echo "preid=${preid}" | ||
# echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc | ||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc | ||
# pnpm --silent lerna version prerelease --preid ${preid} --allow-branch ${{ github.head_ref }} --conventional-prerelease --yes --amend || true | ||
pnpm --silent lerna version prerelease --preid ${preid} --allow-branch ${{ github.head_ref }} --conventional-prerelease --yes --amend || true | ||
# package_version=$(jq -r ".version" package.json) | ||
# package=@kong/markdown@"${package_version}" | ||
package_version=$(jq -r ".version" package.json) | ||
package=@kong/markdown@"${package_version}" | ||
# npm show "${package}" >/dev/null 2>&1 && npm_show_status=0 || npm_show_status=1 | ||
# if [ $npm_show_status -eq 0 ]; then | ||
# echo "Package ${package} is already published. Skipping publishing." | ||
# exit 0 | ||
# fi | ||
npm show "${package}" >/dev/null 2>&1 && npm_show_status=0 || npm_show_status=1 | ||
if [ $npm_show_status -eq 0 ]; then | ||
echo "Package ${package} is already published. Skipping publishing." | ||
exit 0 | ||
fi | ||
# npm_instructions="" | ||
npm_instructions="" | ||
# pkg=$(npm publish --no-git-checks --access public --report-summary --tag "${tag}" | grep "+ "| sed 's/+ //') | ||
pkg=$(npm publish --no-git-checks --access public --report-summary --tag "${tag}" | grep "+ "| sed 's/+ //') | ||
# if [[ -z "${pkg}" ]]; then | ||
# echo "Error publishing package" | ||
# exit -1 | ||
# fi | ||
if [[ -z "${pkg}" ]]; then | ||
echo "Error publishing package" | ||
exit -1 | ||
fi | ||
# npm_instructions="pnpm add @$(echo ${pkg}|cut -d'@' -f2)@${tag}" | ||
npm_instructions="pnpm add @$(echo ${pkg}|cut -d'@' -f2)@${tag}" | ||
# echo "npm_instructions<<EOF" >> $GITHUB_OUTPUT | ||
# echo -e "$npm_instructions" >> $GITHUB_OUTPUT | ||
# echo "EOF" >> $GITHUB_OUTPUT | ||
echo "npm_instructions<<EOF" >> $GITHUB_OUTPUT | ||
echo -e "$npm_instructions" >> $GITHUB_OUTPUT | ||
echo "EOF" >> $GITHUB_OUTPUT | ||
# - name: Provide preview link info | ||
# if: ${{ steps.package-preview.outputs.npm_instructions != '' }} | ||
# uses: marocchino/sticky-pull-request-comment@v2 | ||
# with: | ||
# header: pr_preview_consumption | ||
# message: | | ||
# ### Install the preview package from this PR | ||
- name: Provide preview link info | ||
if: ${{ steps.package-preview.outputs.npm_instructions != '' }} | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
header: pr_preview_consumption | ||
message: | | ||
### Install the preview package from this PR | ||
# ```sh | ||
# ${{ steps.package-preview.outputs.npm_instructions }} | ||
# ``` | ||
# GITHUB_TOKEN: ${{ secrets.KONGPONENTS_BOT_PAT }} | ||
```sh | ||
${{ steps.package-preview.outputs.npm_instructions }} | ||
``` | ||
GITHUB_TOKEN: ${{ secrets.KONGPONENTS_BOT_PAT }} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.