feat(indexd): expand sector stats fields #1049
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: Update Release PR or Release Versions and Publish | |
| permissions: | |
| id-token: write # Required for OIDC: https://docs.npmjs.com/trusted-publishers | |
| contents: write # Required for changesets/action to commit/version and create releases. | |
| pull-requests: write # Needed to update the release PR during versioning. | |
| packages: write # Needed to push Docker images to GHCR via docker/login-action. | |
| actions: write # Needed for called e2e workflows to upload/download artifacts. | |
| on: | |
| push: | |
| branches: | |
| - main | |
| # Note: this workflow does not require an NPM_TOKEN since it uses OIDC trusted publisher authentication. | |
| concurrency: commits-to-main | |
| jobs: | |
| release: | |
| # Release workflow must run on a GitHub-hosted runner since it uses OIDC trusted publisher authentication. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout all commits | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup | |
| uses: ./.github/actions/setup-all | |
| with: | |
| bun_version: 1.2.18 | |
| go_version: 1.24.3 | |
| - name: Build for publishing | |
| shell: bash | |
| run: nx run-many --target=build --configuration=production --all --parallel=5 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # If there are changesets, then we are in PR prep mode and will | |
| # update the release pull request. Note that if there are no changesets | |
| # this step will be skipped because no publish script is specified. | |
| - name: Update release pull request | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| commit: 'chore: release packages' | |
| version: bun run version | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Replace src code with dists for publishing | |
| if: steps.changesets.outputs.hasChangesets == 'false' | |
| run: ./scripts/replace-src-with-dists-for-publishing.sh | |
| # If no changesets were detected in the PR prep step then we are in | |
| # release/publish mode. Check for and publish any new versions to NPM. | |
| - name: Publish to NPM and create GitHub releases | |
| id: changesets_release | |
| if: steps.changesets.outputs.hasChangesets == 'false' | |
| uses: changesets/action@v1 | |
| with: | |
| publish: bun run release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Release Go modules | |
| # If a release was published, release the Go modules | |
| if: steps.changesets_release.outputs.published == 'true' | |
| uses: peter-evans/repository-dispatch@v3 | |
| with: | |
| token: ${{ secrets.PAT_REPOSITORY_DISPATCH }} | |
| repository: siafoundation/web | |
| event-type: release-go | |
| release-docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout all commits | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup | |
| uses: ./.github/actions/setup-all | |
| with: | |
| bun_version: 1.2.18 | |
| go_version: 1.24.3 | |
| - uses: docker/setup-buildx-action@v2 | |
| - uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Containers | |
| shell: bash | |
| run: nx run-many --target=container --configuration=production -all --parallel=5 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Containers zen | |
| shell: bash | |
| run: nx run-many --target=container --configuration=production-testnet-zen -all --parallel=5 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # This job should always pass because the workflow is running run against code that | |
| # was already linted and tested in PR. | |
| # This runs in parallel to the build and release process as an extra check but does | |
| # not actually block the release if job fails. | |
| test-js: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout all commits | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup | |
| uses: ./.github/actions/setup-all | |
| with: | |
| bun_version: 1.2.18 | |
| go_version: 1.24.3 | |
| - name: Lint TypeScript | |
| shell: bash | |
| run: nx run-many --target=lint --all --parallel=5 | |
| - name: Test TypeScript | |
| shell: bash | |
| run: nx run-many --target=test --all --parallel=5 | |
| # This job should always pass because the workflow is running run against code that | |
| # was already linted and tested in PR. | |
| # This runs in parallel to the build and release process as an extra check but does | |
| # not actually block the release if job fails. | |
| e2e: | |
| uses: ./.github/workflows/e2e.yml | |
| # This job should always pass because the workflow is running run against code that | |
| # was already linted and tested in PR. | |
| # This runs in parallel to the build and release process as an extra check but does | |
| # not actually block the release if job fails. | |
| test-go: | |
| # Run matrix since Go modules are used across all platforms | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| module: [./renterd, ./hostd, ./walletd, ./indexd] | |
| steps: | |
| - name: Checkout all commits | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Git | |
| uses: ./.github/actions/setup-git | |
| # Only Go setup is necessary for running Go tests | |
| - name: Setup Go | |
| uses: ./.github/actions/setup-go | |
| with: | |
| go_version: 1.24.3 | |
| - name: Lint Go | |
| uses: golangci/golangci-lint-action@v4 | |
| with: | |
| working-directory: ${{ matrix.module }} | |
| skip-cache: true | |
| - name: Test Go | |
| uses: n8maninger/action-golang-test@v2 | |
| with: | |
| args: '-race' | |
| working-directory: ${{ matrix.module }} |