Merge pull request #16 from abox-dev/release/v0.1.3 #4
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: Release | |
| on: | |
| push: | |
| tags: ['v*.*.*'] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.34.5 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: 0.10.12 | |
| enable-cache: true | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.24.13' | |
| cache: true | |
| cache-dependency-path: packages/go-sdk/go.sum | |
| - run: pnpm install --frozen-lockfile | |
| - run: uv sync --project packages/python-sdk --frozen | |
| - run: uv sync --project packages/code-interpreter-python --frozen | |
| - run: node scripts/check-release-versions.mjs "${GITHUB_REF_NAME}" | |
| - name: Verify matching Go module tag | |
| run: | | |
| go_tag="packages/go-sdk/${GITHUB_REF_NAME}" | |
| go_commit=$(git ls-remote origin "refs/tags/${go_tag}^{}" | cut -f1) | |
| test "$go_commit" = "$GITHUB_SHA" | |
| - run: go test ./... | |
| working-directory: packages/go-sdk | |
| - run: make go-consumer-check | |
| - run: ./scripts/build-release.sh | |
| - run: node scripts/check-public-artifacts.mjs release | |
| - run: ./scripts/test-release-artifacts.sh | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-${{ github.ref_name }} | |
| path: release | |
| if-no-files-found: error | |
| npm: | |
| needs: build | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| # npm Trusted Publishing requires an OIDC-capable npm CLI. Keep this | |
| # version explicit so the release does not depend on the runner default. | |
| - run: npm install --global npm@11.19.0 | |
| - run: npm --version | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: release-${{ github.ref_name }} | |
| path: release | |
| - run: node scripts/publish-npm.mjs release/npm | |
| pypi-core: | |
| needs: build | |
| runs-on: ubuntu-24.04 | |
| environment: pypi | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: release-${{ github.ref_name }} | |
| path: release | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - run: python scripts/check-pypi-digests.py release/pypi abox-sdk "${GITHUB_REF_NAME#v}" | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: release/pypi | |
| skip-existing: true | |
| pypi-code-interpreter: | |
| needs: build | |
| runs-on: ubuntu-24.04 | |
| environment: pypi-code-interpreter | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: release-${{ github.ref_name }} | |
| path: release | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - run: python scripts/check-pypi-digests.py release/pypi-code-interpreter abox-code-interpreter "${GITHUB_REF_NAME#v}" | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: release/pypi-code-interpreter | |
| skip-existing: true | |
| github-release: | |
| needs: [npm, pypi-core, pypi-code-interpreter] | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: release-${{ github.ref_name }} | |
| path: release | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: | | |
| release/SHA256SUMS | |
| release/npm/*.tgz | |
| release/pypi/* | |
| release/pypi-code-interpreter/* | |
| go-proxy-smoke: | |
| needs: github-release | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.24.13' | |
| - run: | | |
| mkdir consumer | |
| cd consumer | |
| go mod init example.com/agentbox-release-smoke | |
| GOPROXY=https://proxy.golang.org go get "github.com/abox-dev/sdk/packages/go-sdk@${GITHUB_REF_NAME}" | |
| go test github.com/abox-dev/sdk/packages/go-sdk github.com/abox-dev/sdk/packages/go-sdk/codeinterpreter | |
| - name: Wait for pkg.go.dev reference pages | |
| env: | |
| VERSION: ${{ github.ref_name }} | |
| run: | | |
| for package in \ | |
| "github.com/abox-dev/sdk/packages/go-sdk" \ | |
| "github.com/abox-dev/sdk/packages/go-sdk/codeinterpreter" | |
| do | |
| url="https://pkg.go.dev/${package}@${VERSION}" | |
| available=false | |
| for attempt in $(seq 1 30) | |
| do | |
| if curl --fail --silent --show-error --location --output /dev/null "$url" | |
| then | |
| available=true | |
| break | |
| fi | |
| sleep 20 | |
| done | |
| test "$available" = true | |
| done |