fix: US state targeting SDK configuration (#2498) #313
This file contains hidden or 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
| name: publish-theme | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| concurrency: | |
| group: publish-theme | |
| cancel-in-progress: false | |
| permissions: | |
| id-token: write | |
| contents: write | |
| jobs: | |
| look_for_change: | |
| if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | |
| runs-on: ubuntu-latest | |
| outputs: | |
| theme_changed: ${{ steps.changed-theme-files.outputs.any_changed }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Check changes in theme | |
| id: changed-theme-files | |
| uses: tj-actions/changed-files@v47 | |
| with: | |
| since_last_remote_commit: "true" | |
| files: | | |
| apify-docs-theme/** | |
| publish: | |
| needs: look_for_change | |
| if: ${{ needs.look_for_change.outputs.theme_changed == 'true' || github.event_name == 'workflow_dispatch' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| registry-url: 'https://registry.npmjs.org' | |
| - uses: apify/workflows/pnpm-install@main | |
| - name: Setup git user and npm | |
| run: | | |
| git config --global user.name "Apify Release Bot" | |
| git config --global user.email "noreply@apify.com" | |
| - name: Bump the theme version | |
| run: | | |
| cd "$GITHUB_WORKSPACE/apify-docs-theme" | |
| PACKAGE_NAME=$(jq -r .name package.json) | |
| LATEST_VERSION=$(pnpm show "$PACKAGE_NAME" version 2>/dev/null || jq -r .version package.json) | |
| pnpm pkg set "version=$LATEST_VERSION" | |
| pnpm version patch --no-git-tag-version | |
| - name: Deploy theme to npm | |
| run: | | |
| cd "$GITHUB_WORKSPACE/apify-docs-theme" | |
| pnpm publish --no-git-checks | |
| - name: Wait until the new theme version is available on npm | |
| run: | | |
| cd "$GITHUB_WORKSPACE/apify-docs-theme" | |
| PACKAGE_NAME=$(jq -r .name package.json); | |
| PACKAGE_VER=$(jq -r .version package.json); | |
| for _ in $(seq 1 10); do | |
| EXIT_CODE=0; | |
| pnpm show "$PACKAGE_NAME@$PACKAGE_VER" || EXIT_CODE=1; | |
| if [[ $EXIT_CODE -eq 1 ]]; then | |
| echo "The new package version ($PACKAGE_VER) is not yet available, waiting 30 seconds..."; | |
| sleep 30; | |
| continue; | |
| fi; | |
| echo "The new package version ($PACKAGE_VER) is live, proceeding!"; | |
| break; | |
| done; | |
| pnpm show "$PACKAGE_NAME@$PACKAGE_VER" # fails if the package is not available, succeeds if it is | |
| - name: Commit the new theme version | |
| continue-on-error: true | |
| uses: EndBug/add-and-commit@v10 | |
| with: | |
| add: 'apify-docs-theme/package*.json' | |
| author_name: github-actions[bot] | |
| author_email: 41898282+github-actions[bot]@users.noreply.github.com | |
| message: 'chore: publish new version of @apify/docs-theme [skip ci]' | |
| pull: '--rebase --autostash' | |
| rebuild-docs: | |
| needs: publish | |
| strategy: | |
| matrix: | |
| repo: | |
| - apify/apify-sdk-js | |
| - apify/apify-cli | |
| - apify/apify-client-js | |
| runs-on: ubuntu-latest | |
| steps: | |
| - env: | |
| GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} | |
| run: | | |
| gh workflow run docs.yaml --repo ${{ matrix.repo }} | |
| rebuild-python-docs: | |
| needs: publish | |
| strategy: | |
| matrix: | |
| repo: | |
| - apify/apify-sdk-python | |
| - apify/apify-client-python | |
| runs-on: ubuntu-latest | |
| steps: | |
| - env: | |
| GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} | |
| run: | | |
| gh workflow run manual_release_docs.yaml --repo ${{ matrix.repo }} |