-
Notifications
You must be signed in to change notification settings - Fork 539
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2118 from kubernetes-client/master
Merge `master` into `release-0.x`
- Loading branch information
Showing
854 changed files
with
115,455 additions
and
95,490 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "02:00" | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
target-branch: "release-1.x" | ||
schedule: | ||
interval: "daily" | ||
time: "01:00" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "03:00" |
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
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,80 @@ | ||
name: Generate | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
kubernetesBranch: | ||
type: string | ||
required: true | ||
description: 'The remote kubernetes release branch to fetch openapi spec. .e.g. "release-1.23"' | ||
genCommit: | ||
type: string | ||
required: true | ||
default: 'f0bb447' | ||
description: 'The commit to use for the kubernetes-client/gen repo' | ||
|
||
|
||
jobs: | ||
generate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Javascript | ||
uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
- name: Checkout Gen | ||
run: | | ||
git clone https://github.com/kubernetes-client/gen | ||
pushd gen | ||
git checkout "${{ github.event.inputs.genCommit }}" | ||
# apply https://github.com/kubernetes-client/gen/pull/224 | ||
git config --global user.name "Github Actions" | ||
git config --global user.email "<>" | ||
git cherry-pick --strategy=recursive -X theirs c557f7f b32dcd6 0ef2cec 9701a7c a608a9d | ||
rm -rf gen/.git | ||
# apply https://github.com/kubernetes-client/gen/pull/237 | ||
- name: Patch Dockerfile | ||
run: echo "RUN git config --system --add safe.directory /source/openapi-generator" >> gen/openapi/openapi-generator/Dockerfile | ||
- name: Generate Branch Name | ||
run: | | ||
SUFFIX=$(openssl rand -hex 4) | ||
echo "BRANCH=automated-generate-$SUFFIX" >> $GITHUB_ENV | ||
- name: Generate Openapi | ||
run: | | ||
pushd gen/openapi | ||
cat <<"EOF"> settings | ||
# kubernetes-client/gen commit to use for code generation. | ||
export GEN_COMMIT="${{ github.event.inputs.genCommit }}" | ||
# GitHub username/organization to clone kubernetes repo from. | ||
export USERNAME=kubernetes | ||
# Kubernetes branch/tag to get the OpenAPI spec from. | ||
export KUBERNETES_BRANCH="${{ github.event.inputs.kubernetesBranch }}" | ||
# client version for packaging and releasing. It can | ||
# be different than SPEC_VERSION. | ||
export CLIENT_VERSION="0.8-SNAPSHOT" | ||
# Name of the release package | ||
export PACKAGE_NAME="@kubernetes/node-client" | ||
export OPENAPI_GENERATOR_COMMIT=1314e229 | ||
EOF | ||
bash typescript.sh ../../src/gen settings | ||
popd | ||
cp settings ../../settings | ||
rm -rf gen | ||
- name: Commit and push | ||
run: | | ||
# Commit and push | ||
git config user.email "[email protected]" | ||
git config user.name "Kubernetes Prow Robot" | ||
git checkout -b "$BRANCH" | ||
git add . | ||
git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}' | ||
git push origin "$BRANCH" | ||
- name: Pull Request | ||
uses: repo-sync/pull-request@v2 | ||
with: | ||
source_branch: ${{ env.BRANCH }} | ||
destination_branch: ${{ github.ref_name }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
pr_title: "Automated Generate from openapi ${{ github.event.inputs.kubernetesBranch }}" |
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,64 @@ | ||
name: Release | ||
|
||
permissions: | ||
contents: write | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releaseVersion: | ||
type: string | ||
required: true | ||
description: The version of this release. Must be a semantic version of the form X.Y.Z. | ||
dry_run: | ||
type: boolean | ||
required: true | ||
default: false | ||
description: Dry run, will not push branches or upload the artifacts. | ||
pre_release: | ||
type: boolean | ||
required: true | ||
default: false | ||
description: If true, push pre-release tag. | ||
skip_tag: | ||
type: boolean | ||
required: true | ||
default: false | ||
description: If true, don't tag this release, just push it. | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
environment: production | ||
steps: | ||
- name: Checkout Javascript | ||
uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Package | ||
run: ./build-package.sh | ||
- name: Upload | ||
if: ${{ github.event.inputs.dry_run != 'true' && github.event.inputs.pre_release != 'true' }} | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | ||
- name: Upload pre-release | ||
if: ${{ github.event.inputs.dry_run != 'true' && github.event.inputs.pre_release == 'true' }} | ||
run: npm publish --tag next | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | ||
- name: Tag release | ||
if: ${{ github.event.inputs.skip_tag != 'true' }} | ||
run: | | ||
git config --global user.name 'Github Bot' | ||
git config --global user.email '<>' | ||
git tag ${{ github.events.inputs.releaseVersion }} | ||
- name: Push tag | ||
if: ${{ github.event.inputs.dry_run != 'true' }} | ||
run: | | ||
git push ${{ github.events.inputs.releaseVersion }} |
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 @@ | ||
pretty-quick |
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 @@ | ||
npm test && npm run lint |
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,10 @@ | ||
{ | ||
"require": "tsx", | ||
"extensions": ["ts"], | ||
"spec": [ | ||
"src/**/*_test.ts" | ||
], | ||
"watch-files": [ | ||
"src" | ||
] | ||
} |
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
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 |
---|---|---|
@@ -1,10 +1,15 @@ | ||
# See the OWNERS docs at https://go.k8s.io/owners | ||
approvers: | ||
- brendandburns | ||
- drubin | ||
- mstruebing | ||
- davidgamero | ||
- cjihrig | ||
reviewers: | ||
- brendandburns | ||
- drubin | ||
- itowlson | ||
- mstruebing | ||
- davidgamero | ||
- cjihrig | ||
emeritus_approvers: | ||
- mbohlool # 10/22/2020 | ||
- drubin # 11/23/2023 | ||
- itowlson # 11/23/2023 |
Oops, something went wrong.