Inbound FEP-044f quote authorization #274
Workflow file for this run
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: main | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| - "*.*-maintenance" | |
| tags: | |
| - "*.*.*" | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:17 | |
| env: | |
| POSTGRES_DB: botkit_test | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_USER: postgres | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| permissions: | |
| checks: write | |
| pull-requests: write | |
| env: | |
| POSTGRES_URL: postgres://postgres:postgres@localhost:5432/botkit_test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: jdx/mise-action@v4 | |
| with: | |
| cache: true | |
| - run: mise run test:deno -- --coverage --junit-path=junit.xml | |
| env: | |
| RUST_BACKTRACE: ${{ runner.debug }} | |
| - uses: EnricoMi/publish-unit-test-result-action@v2 | |
| with: | |
| check_name: "Test Results" | |
| files: junit.xml | |
| continue-on-error: true | |
| - if: '!cancelled()' | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - run: deno coverage --lcov > coverage.lcov | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: coverage.lcov | |
| - run: mise run test:node | |
| - run: mise run check | |
| publish: | |
| if: github.event_name == 'push' | |
| needs: [test] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: jdx/mise-action@v4 | |
| with: | |
| cache: true | |
| - if: github.ref_type == 'branch' | |
| run: | | |
| set -euo pipefail | |
| jq \ | |
| --arg build "$GITHUB_RUN_NUMBER" \ | |
| --arg commit "${GITHUB_SHA::8}" \ | |
| '.version = .version + "-dev." + $build + "+" + $commit' \ | |
| packages/botkit/deno.json > deno.json.tmp | |
| mv deno.json.tmp packages/botkit/deno.json | |
| mise run check-versions -- --fix | |
| - if: github.ref_type == 'tag' | |
| run: | | |
| set -euo pipefail | |
| [[ "$(jq -r .version packages/botkit/deno.json)" = "$GITHUB_REF_NAME" ]] | |
| mise run check-versions | |
| - run: | | |
| set -euo pipefail | |
| if [[ "$GITHUB_REF_TYPE" = tag ]]; then | |
| pnpm publish --recursive --access public --no-git-checks | |
| else | |
| pnpm publish --recursive --access public --no-git-checks --tag dev | |
| fi | |
| env: | |
| NPM_CONFIG_PROVENANCE: "true" | |
| - run: | | |
| set -euo pipefail | |
| max_attempts=30 | |
| timeout_seconds=60 | |
| for attempt in $(seq 1 "$max_attempts"); do | |
| echo "Publishing to JSR (attempt $attempt/$max_attempts)..." | |
| set +e | |
| timeout --foreground "${timeout_seconds}s" deno publish --allow-dirty | |
| status=$? | |
| set -e | |
| if [[ "$status" -eq 0 ]]; then | |
| exit 0 | |
| fi | |
| if [[ "$attempt" -eq "$max_attempts" ]]; then | |
| echo "deno publish failed after $max_attempts attempts." | |
| exit "$status" | |
| fi | |
| if [[ "$status" -eq 124 ]]; then | |
| echo "deno publish timed out after ${timeout_seconds}s; retrying." | |
| else | |
| echo "deno publish failed with exit code $status; retrying." | |
| fi | |
| sleep 5 | |
| done | |
| - if: github.ref_type == 'tag' | |
| id: extract-changelog | |
| uses: dahlia/submark@ed8f47b4d51fda07e12b6e991641a8bd5ec62f8e | |
| with: | |
| input-file: CHANGES.md | |
| heading-level: 2 | |
| heading-title-text: version ${{ github.ref_name }} | |
| ignore-case: true | |
| omit-heading: true | |
| - if: github.ref_type == 'tag' | |
| run: 'cat "$CHANGES_FILE"' | |
| env: | |
| CHANGES_FILE: ${{ steps.extract-changelog.outputs.output-file }} | |
| - if: github.ref_type == 'tag' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body_path: ${{ steps.extract-changelog.outputs.output-file }} | |
| name: BotKit ${{ github.ref_name }} | |
| generate_release_notes: false | |
| publish-docs: | |
| if: github.event_name == 'push' | |
| needs: [publish] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deploy.outputs.page_url }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: jdx/mise-action@v4 | |
| with: | |
| cache: true | |
| - run: mise run docs:build | |
| env: | |
| PLAUSIBLE_DOMAIN: ${{ vars.PLAUSIBLE_DOMAIN }} | |
| SITEMAP_HOSTNAME: https://${{ vars.PLAUSIBLE_DOMAIN }} | |
| - id: upload | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/.vitepress/dist | |
| - id: deploy | |
| uses: actions/deploy-pages@v4 | |
| # cSpell: ignore submark softprops pipefail npmjs |