Compare commits
2 Commits
e8d4966441
...
7a0d3e81aa
| Author | SHA1 | Date | |
|---|---|---|---|
|
7a0d3e81aa
|
|||
|
f6c3434a5c
|
44
.github/workflows/generate.yml
vendored
44
.github/workflows/generate.yml
vendored
@@ -4,23 +4,30 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 3 * * 1"
|
- cron: "0 3 * * 1"
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
generate-crds:
|
generate-and-publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
# VITAL: This token makes the push trigger the NEXT workflow
|
|
||||||
token: ${{ secrets.GH_PAT }}
|
|
||||||
|
|
||||||
- run: npm install -g npm@latest
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '20'
|
||||||
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|
||||||
|
# Force latest NPM to support OIDC correctly
|
||||||
|
- name: Update NPM
|
||||||
|
run: npm install -g npm@latest
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -29,7 +36,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Fetch binaries & Generate
|
- name: Fetch binaries & Generate
|
||||||
run: |
|
run: |
|
||||||
# (Simplified for brevity - keep your existing binary fetch logic here)
|
GW_VERSION=$(curl -s https://api.github.com/repos/kubernetes-sigs/gateway-api/releases/latest | jq -r .tag_name)
|
||||||
|
echo "GW_VERSION=$GW_VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
CM_VERSION=$(curl -s https://api.github.com/repos/cert-manager/cert-manager/releases/latest | jq -r .tag_name)
|
||||||
|
echo "CM_VERSION=$CM_VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
CRD2PULUMI_VERSION=1.6.0
|
CRD2PULUMI_VERSION=1.6.0
|
||||||
curl -L "https://github.com/pulumi/crd2pulumi/releases/download/v${CRD2PULUMI_VERSION}/crd2pulumi-v${CRD2PULUMI_VERSION}-linux-amd64.tar.gz" -o crd2pulumi.tar.gz
|
curl -L "https://github.com/pulumi/crd2pulumi/releases/download/v${CRD2PULUMI_VERSION}/crd2pulumi-v${CRD2PULUMI_VERSION}-linux-amd64.tar.gz" -o crd2pulumi.tar.gz
|
||||||
tar -xzf crd2pulumi.tar.gz
|
tar -xzf crd2pulumi.tar.gz
|
||||||
@@ -38,22 +50,18 @@ jobs:
|
|||||||
|
|
||||||
node generate-crds.js
|
node generate-crds.js
|
||||||
|
|
||||||
- name: Check for changes
|
- name: Bump version and Commit
|
||||||
id: git-check
|
|
||||||
run: |
|
|
||||||
git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Bump Version and Push
|
|
||||||
if: steps.git-check.outputs.changes == 'true'
|
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "github-actions[bot]"
|
git config --global user.name "github-actions[bot]"
|
||||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
# Bump version in package.json
|
# Bump version (updates package.json)
|
||||||
npm version patch --no-git-tag-version
|
npm version patch --no-git-tag-version
|
||||||
|
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Update CRDs and bump version"
|
git commit -m "Update CRDs and bump version"
|
||||||
|
git push
|
||||||
# This push (authenticated by GH_PAT) will trigger the publish.yml workflow
|
|
||||||
git push
|
- name: Publish to npm (Trusted Publishing)
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
|
run: npm publish --provenance --access public
|
||||||
30
.github/workflows/publisher.yml
vendored
30
.github/workflows/publisher.yml
vendored
@@ -1,30 +0,0 @@
|
|||||||
name: Publish to NPM
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ main ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '20'
|
|
||||||
registry-url: 'https://registry.npmjs.org'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm install
|
|
||||||
|
|
||||||
- name: Publish to npm (Trusted Publishing)
|
|
||||||
run: npm publish --provenance --access public
|
|
||||||
env:
|
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "pulumi-extra-crds",
|
"name": "pulumi-extra-crds",
|
||||||
"version": "1.0.8",
|
"version": "1.0.9",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"generate": "node scripts/generate-crds.js",
|
"generate": "node scripts/generate-crds.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user