mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Merge branch 'master' into enhancement-ability-to-remove-subnamespaces
This commit is contained in:
commit
95a3d3b144
103
.github/workflows/daily-alpha.yml
vendored
Normal file
103
.github/workflows/daily-alpha.yml
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
name: Release daily alpha
|
||||
on:
|
||||
schedule:
|
||||
- cron: 0 0 30 * 1-5 # At 12:30am UTC work day
|
||||
workflow_dispatch: # for testing
|
||||
jobs:
|
||||
tag:
|
||||
outputs:
|
||||
tagname: v${{ steps.version.outputs.VERSION }}
|
||||
version: ${{ steps.version.outputs.VERSION }}
|
||||
continue: ${{ steps.create-branch.outputs.CONTINUE }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16.x"
|
||||
registry-url: "https://npm.pkg.github.com"
|
||||
|
||||
- name: Install deps
|
||||
run: |
|
||||
npm i --location=global semver
|
||||
npm install
|
||||
|
||||
sudo apt-get install -y ripgrep
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Bump version
|
||||
id: version
|
||||
run: npm run bump-version-for-cron
|
||||
- name: Check if branch already exists
|
||||
id: check-branch
|
||||
run: git ls-remote --exit-code --tags origin v${{ steps.version.outputs.VERSION }}
|
||||
continue-on-error: true
|
||||
- name: Create branch and tag and push
|
||||
id: create-branch
|
||||
run: |
|
||||
# failure means that the tag doesn't exist so we should create it
|
||||
if [ ${{ steps.check-branch.outcome }} != 'failure' ]; then
|
||||
echo "CONTINUE=false" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
git config --global user.email "bot@k8slens.dev"
|
||||
git config --global user.name "k8slens bot"
|
||||
|
||||
git checkout -b release/v${{ steps.version.outputs.VERSION }}
|
||||
git add .
|
||||
git commit -sm "Release ${{ steps.version.outputs.VERSION }}"
|
||||
git tag v${{ steps.version.outputs.VERSION }}
|
||||
git push origin v${{ steps.version.outputs.VERSION }}
|
||||
echo "CONTINUE=true" >> "$GITHUB_OUTPUT"
|
||||
create_release:
|
||||
outputs:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
version: ${{ needs.tag.outputs.version }}
|
||||
needs: [tag]
|
||||
if: ${{ needs.tag.outputs.continue == 'true' }}
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Create GitHub release
|
||||
uses: softprops/action-gh-release@v1
|
||||
id: create_release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ needs.tag.outputs.tagname }}
|
||||
name: ${{ needs.tag.outputs.tagname }}
|
||||
generate_release_notes: true
|
||||
prerelease: true
|
||||
release_packages:
|
||||
needs: [create_release]
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: v${{ needs.create_release.outputs.version }}
|
||||
- name: Use Node.js ${{ env.NODE_VERSION }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16.x"
|
||||
cache: "npm"
|
||||
registry-url: "https://npm.pkg.github.com"
|
||||
- name: Build package
|
||||
shell: bash
|
||||
run: |
|
||||
yarn install --frozen-lockfile
|
||||
yarn run build
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Release to GitHub NPM registry
|
||||
run: |
|
||||
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
|
||||
yarn lerna \
|
||||
publish from-package \
|
||||
--no-push \
|
||||
--no-git-tag-version \
|
||||
--yes \
|
||||
--dist-tag cron
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
38
.github/workflows/publish-master-npm.yml
vendored
38
.github/workflows/publish-master-npm.yml
vendored
@ -1,38 +0,0 @@
|
||||
name: Publish NPM Package `master`
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- closed
|
||||
concurrency:
|
||||
group: publish-master-npm
|
||||
cancel-in-progress: true
|
||||
jobs:
|
||||
publish:
|
||||
name: Publish Extensions NPM Package `master`
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'area/extension') }}
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [16.x]
|
||||
steps:
|
||||
- name: Checkout Release
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Using Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Generate NPM packages
|
||||
run: |
|
||||
yarn install --frozen-lockfile
|
||||
yarn run build
|
||||
|
||||
- name: Publish NPM package
|
||||
run: |
|
||||
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
|
||||
yarn lerna publish from-package --dist-tag master --no-push --no-git-tag-version --yes
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
2
.github/workflows/publish-release-npm.yml
vendored
2
.github/workflows/publish-release-npm.yml
vendored
@ -40,7 +40,7 @@ jobs:
|
||||
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
|
||||
VERSION=$(cat lerna.json | jq '.version' --raw-output)
|
||||
echo ${VERSION}
|
||||
DIST_TAG=$(npm exec -- @k8slens/semver --prerelease 0 ${VERSION})
|
||||
DIST_TAG=$(node packages/semver/dist/index.js --prerelease 0 ${VERSION})
|
||||
yarn lerna \
|
||||
publish from-package \
|
||||
--no-push \
|
||||
|
||||
@ -18,12 +18,11 @@
|
||||
"test:unit": "lerna run --stream test:unit",
|
||||
"test:integration": "lerna run --stream test:integration",
|
||||
"bump-version": "lerna version --no-git-tag-version --no-push",
|
||||
"create-release-pr": "create-release-pr",
|
||||
"precreate-release-pr": "cd packages/release-tool && yarn run build",
|
||||
"create-release-pr": "node packages/release-tool/dist/index.js",
|
||||
"postinstall": "lerna bootstrap --ignore open-lens && lerna bootstrap --scope open-lens --include-dependencies"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@k8slens/semver": "./packages/semver",
|
||||
"@k8slens/release-tool": "./packages/release-tool",
|
||||
"adr": "^1.4.3",
|
||||
"cross-env": "^7.0.3",
|
||||
"lerna": "^6.4.1",
|
||||
|
||||
@ -22,4 +22,8 @@
|
||||
@include namespaceStatus;
|
||||
}
|
||||
}
|
||||
|
||||
.subnamespaceBadge {
|
||||
margin-inline-start: var(--margin);
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@ import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import namespaceStoreInjectable from "./store.injectable";
|
||||
import { KubeObjectAge } from "../kube-object/age";
|
||||
import openAddNamepaceDialogInjectable from "./add-dialog/open.injectable";
|
||||
import { SubnamespaceBadge } from "./subnamespace-badge";
|
||||
|
||||
enum columnId {
|
||||
name = "name",
|
||||
@ -55,7 +56,12 @@ const NonInjectedNamespacesRoute = ({ namespaceStore, openAddNamespaceDialog }:
|
||||
{ title: "Status", className: "status", sortBy: columnId.status, id: columnId.status },
|
||||
]}
|
||||
renderTableContents={namespace => [
|
||||
namespace.getName(),
|
||||
<>
|
||||
{namespace.getName()}
|
||||
{namespace.isSubnamespace() && (
|
||||
<SubnamespaceBadge className="subnamespaceBadge" id={`namespace-list-badge-for-${namespace.getId()}`} />
|
||||
)}
|
||||
</>,
|
||||
<KubeObjectStatusIcon key="icon" object={namespace} />,
|
||||
namespace.getLabels().map(label => (
|
||||
<Badge
|
||||
|
||||
@ -6,16 +6,17 @@ import styles from "./subnamespace-badge.module.scss";
|
||||
|
||||
import React from "react";
|
||||
import { Tooltip } from "../tooltip";
|
||||
import { cssNames } from "../../utils";
|
||||
|
||||
interface SubnamespaceBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export function SubnamespaceBadge({ id, ...other }: SubnamespaceBadgeProps) {
|
||||
export function SubnamespaceBadge({ id, className, ...other }: SubnamespaceBadgeProps) {
|
||||
return (
|
||||
<>
|
||||
<span
|
||||
className={styles.subnamespaceBadge}
|
||||
className={cssNames(styles.subnamespaceBadge, className)}
|
||||
data-testid={id}
|
||||
id={id}
|
||||
{...other}
|
||||
|
||||
11
yarn.lock
11
yarn.lock
@ -38,17 +38,6 @@
|
||||
resolved "https://registry.yarnpkg.com/@isaacs/string-locale-compare/-/string-locale-compare-1.1.0.tgz#291c227e93fd407a96ecd59879a35809120e432b"
|
||||
integrity sha512-SQ7Kzhh9+D+ZW9MA0zkYv3VXhIDNx+LzM6EJ+/65I3QY+enU6Itte7E5XX7EWrqLW2FN4n06GWzBnPoC3th2aQ==
|
||||
|
||||
"@k8slens/release-tool@./packages/release-tool":
|
||||
version "6.4.0-beta.13"
|
||||
dependencies:
|
||||
rimraf "^4.1.2"
|
||||
|
||||
"@k8slens/semver@./packages/semver":
|
||||
version "6.4.0-beta.13"
|
||||
dependencies:
|
||||
command-line-args "^5.2.1"
|
||||
semver "^7.3.8"
|
||||
|
||||
"@lerna/add@6.4.1":
|
||||
version "6.4.1"
|
||||
resolved "https://registry.yarnpkg.com/@lerna/add/-/add-6.4.1.tgz#fa20fe9ff875dc5758141262c8cde0d9a6481ec4"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user