From ac04a2bc4cd5f894c6df5c2aad28f09242a8b4c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mih=C3=A1ly=20T=C3=B3th?= Date: Sat, 6 Sep 2025 12:27:10 +0200 Subject: [PATCH] chore: worfklows maintenance --- .github/actions/upload-docs/action.yml | 16 +++++++++ .github/workflows/add-docs-to-release.yml | 11 ++++-- .github/workflows/release.yml | 17 ++++----- .github/workflows/upload-docs.yml | 42 +++++++++++++++++++++++ package.json | 14 ++++---- 5 files changed, 80 insertions(+), 20 deletions(-) create mode 100644 .github/actions/upload-docs/action.yml create mode 100644 .github/workflows/upload-docs.yml diff --git a/.github/actions/upload-docs/action.yml b/.github/actions/upload-docs/action.yml new file mode 100644 index 0000000..b2fc972 --- /dev/null +++ b/.github/actions/upload-docs/action.yml @@ -0,0 +1,16 @@ +# .github/actions/upload-docs/action.yml +name: Upload Docs to GCP +description: Build and upload docs to GCP Storage +runs: + using: 'composite' + steps: + - name: Authenticate GCP + uses: google-github-actions/auth@v3 + with: + credentials_json: '${{ secrets.GCP_CREDENTIALS }}' + + - name: Upload docs folder to GCP + uses: google-github-actions/upload-cloud-storage@v3 + with: + path: 'docs' + destination: 'calycode.com/cli' diff --git a/.github/workflows/add-docs-to-release.yml b/.github/workflows/add-docs-to-release.yml index e97cdb9..e1fffc1 100644 --- a/.github/workflows/add-docs-to-release.yml +++ b/.github/workflows/add-docs-to-release.yml @@ -1,3 +1,4 @@ +# .github/workflows/add-docs-to-release.yml name: Generate Docs on: @@ -8,7 +9,7 @@ on: jobs: generate-docs: - if: github.actor == 'github-actions[bot]' + if: github.repository == 'calycode/xano-tools' && github.repository_owner == 'calycode' && startsWith(github.head_ref, 'changeset-release') runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -24,10 +25,14 @@ jobs: with: node-version: 20.x - - run: pnpm install + - name: Install packages + run: pnpm install + + - name: Build packages + run: pnpm build:packages - name: Build Docs - run: pnpm docs:build + run: pnpm build:docs - name: Commit and push docs run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 19be413..4f4ec69 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,3 +1,4 @@ +# .github/workflows/release.yml name: Release Caly-Xano CLI on: @@ -7,6 +8,8 @@ on: jobs: release: + if: github.repository == 'calycode/xano-tools' && github.repository_owner == 'calycode' + name: Release CLI runs-on: ubuntu-latest steps: @@ -36,20 +39,14 @@ jobs: id: changesets uses: changesets/action@v1 with: + commit: 'changeset-release' + title: 'Release Version' publish: pnpm -r publish --access restricted env: GITHUB_TOKEN: ${{ secrets.CHANGESETS_GH_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # Upload docs to GCP ONLY after publishing - - name: Authenticate GCP + - name: Upload docs if: steps.changesets.outputs.published == 'true' - uses: google-github-actions/auth@v3 - with: - credentials_json: '${{ secrets.GCP_CREDENTIALS }}' - - - name: Upload docs folder to GCP - uses: google-github-actions/upload-cloud-storage@v3 - with: - path: 'docs' - destination: 'calycode.com/cli' + uses: './.github/actions/upload-docs' diff --git a/.github/workflows/upload-docs.yml b/.github/workflows/upload-docs.yml new file mode 100644 index 0000000..30290a6 --- /dev/null +++ b/.github/workflows/upload-docs.yml @@ -0,0 +1,42 @@ +# .github/workflows/upload-docs.yml +name: Release Docs for Caly-Xano CLI + +on: + workflow_dispatch + +jobs: + release: + name: Release Docs + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + run_install: true + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20.x + registry-url: 'https://registry.npmjs.org' + scope: '@calycode' + always-auth: true + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Install dependencies + run: pnpm install + + - name: Build packages + run: pnpm build:packages + + - name: Update the docs + run: pnpm build:docs + + # Upload docs to GCP ONLY after publishing + - name: Upload docs + uses: './.github/actions/upload-docs' \ No newline at end of file diff --git a/package.json b/package.json index 4a48c6d..5d730da 100644 --- a/package.json +++ b/package.json @@ -31,15 +31,15 @@ "author": "Mihály Tóth ", "devDependencies": { "@changesets/cli": "^2.29.6", - "@eslint/js": "^9.34.0", - "@types/node": "^24.3.0", - "@typescript-eslint/eslint-plugin": "^8.41.0", - "@typescript-eslint/parser": "^8.41.0", + "@eslint/js": "^9.35.0", + "@types/node": "^24.3.1", + "@typescript-eslint/eslint-plugin": "^8.42.0", + "@typescript-eslint/parser": "^8.42.0", "esbuild": "^0.25.9", - "eslint": "^9.34.0", + "eslint": "^9.35.0", "eslint-plugin-import": "^2.32.0", - "knip": "^5.63.0", - "rollup": "^4.49.0", + "knip": "^5.63.1", + "rollup": "^4.50.0", "rollup-plugin-dts": "^6.2.3", "strip-ansi": "^7.1.0", "trash-cli": "^6.0.0",