Skip to content

Commit

Permalink
feat: tooltips and buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdehaven committed Dec 20, 2023
1 parent ca0b880 commit 9cabe4b
Show file tree
Hide file tree
Showing 18 changed files with 657 additions and 390 deletions.
61 changes: 0 additions & 61 deletions .github/workflows/github-pages.yaml

This file was deleted.

14 changes: 8 additions & 6 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- main
- alpha
- beta

jobs:
run-tests:
Expand Down Expand Up @@ -40,10 +42,10 @@ jobs:
# Since we lint in the Tests job, we can just build here
run: pnpm run build

# - name: Semantic Release
# uses: cycjimmy/semantic-release-action@v3
# env:
# # Since branch protections are on (pushing commits) you need to use a bot PAT
# GITHUB_TOKEN: ${{ secrets.KONGPONENTS_BOT_PAT }}
# NPM_TOKEN: ${{ secrets.NPM_TOKEN_PUBLIC_PUBLISH }}
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
env:
# Since branch protections are on (pushing commits) you need to use a bot PAT
GITHUB_TOKEN: ${{ secrets.KONGPONENTS_BOT_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN_PUBLIC_PUBLISH }}

86 changes: 44 additions & 42 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
- labeled
branches:
- main
- alpha
- beta

# Allow calling manually from GitHub
workflow_dispatch:
Expand Down Expand Up @@ -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 }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"vue": "^3.3.8"
},
"dependencies": {
"@kong/icons": "^1.8.7",
"@sindresorhus/slugify": "^2.2.1",
"@vueuse/core": "^10.7.0",
"html-format": "^1.1.2",
Expand Down
12 changes: 12 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9cabe4b

Please sign in to comment.