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 dd70d76..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: startsWith(github.head_ref, 'changeset-release/') + 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,7 +25,11 @@ 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 build:docs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 01bac85..883c013 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: @@ -50,15 +53,6 @@ jobs: echo "hasChangesets: ${{ steps.changesets.outputs.hasChangesets }}" # 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 - if: steps.changesets.outputs.published == 'true' - uses: google-github-actions/upload-cloud-storage@v3 - with: - path: 'docs' - destination: 'calycode.com/cli' + uses: './.github/actions/upload-docs' \ No newline at end of file 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",