version: 1.19.2 (#786) #90
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 dbt-mcp | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - CHANGELOG.md | |
| jobs: | |
| create-release-tag: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| changie-latest: ${{ steps.changie-latest.outputs.output }} | |
| if: "startsWith(github.event.head_commit.message, 'version:')" | |
| steps: | |
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # actions/checkout@v4 | |
| - uses: ./.github/actions/setup-python | |
| - name: Get the latest version | |
| id: changie-latest | |
| uses: miniscruff/changie-action@6dcc2533cac0495148ed4046c438487e4dceaa23 | |
| with: | |
| version: latest | |
| args: latest | |
| - name: Create tag | |
| env: | |
| TAG: ${{ steps.changie-latest.outputs.output }} | |
| run: | | |
| git config user.name "release-bot" | |
| git config user.email "release-bot@users.noreply.github.com" | |
| git tag "$TAG" | |
| git push origin "$TAG" | |
| pypi-publish: | |
| runs-on: ubuntu-latest | |
| needs: create-release-tag | |
| environment: | |
| name: pypi | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # actions/checkout@v4 | |
| with: | |
| ref: ${{ needs.create-release-tag.outputs.changie-latest }} | |
| fetch-tags: true | |
| - name: setup python | |
| uses: ./.github/actions/setup-python | |
| id: setup-python | |
| - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda | |
| with: | |
| version: 10 | |
| - name: Install go-task | |
| run: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin | |
| - name: Run tests | |
| run: task test:unit | |
| - name: Build | |
| run: task build | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc | |
| with: | |
| packages-dir: ./dist | |
| create-github-release: | |
| runs-on: ubuntu-latest | |
| needs: create-release-tag | |
| permissions: | |
| contents: write # required to create a release | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetches all history for changie to work correctly | |
| - name: Get the latest version | |
| id: changie-latest | |
| uses: miniscruff/changie-action@6dcc2533cac0495148ed4046c438487e4dceaa23 | |
| with: | |
| version: latest | |
| args: latest | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| VERSION: ${{ steps.changie-latest.outputs.output }} | |
| run: | | |
| echo "Creating release for version: $VERSION" | |
| gh release create "$VERSION" \ | |
| --notes-file ".changes/$VERSION.md" \ | |
| --title "$VERSION" | |
| mcpb-pack: | |
| runs-on: ubuntu-latest | |
| needs: [create-release-tag, create-github-release] | |
| permissions: | |
| contents: write # required to upload release assets | |
| env: | |
| MCPB_PACKAGE_NAME: dbt-mcp.mcpb | |
| # MCPB_CERT: ${{ secrets.MCPB_CERT }} | |
| # MCPB_KEY: ${{ secrets.MCPB_KEY }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # actions/checkout@v4 | |
| with: | |
| ref: ${{ needs.create-release-tag.outputs.changie-latest }} | |
| fetch-tags: true | |
| - name: Setup mcpb | |
| uses: ./.github/actions/setup-mcpb | |
| - name: Setup python | |
| uses: ./.github/actions/setup-python | |
| - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda | |
| with: | |
| version: 10 | |
| - name: Install go-task | |
| run: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin | |
| - name: Pack mcpb package | |
| run: task mcpb:pack | |
| # Tested locally, 01/07/26 with valid MCPB_CERT and MCPB_KEY pair | |
| # but `mcpb verify` failed due to known mcpb bug: | |
| # https://github.com/modelcontextprotocol/mcpb/issues/21 | |
| # - name: Sign and verify bundle | |
| # run: task mcpb:sign-and-verify | |
| - name: Upload mcpb package to release | |
| uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2 | |
| with: | |
| tag_name: ${{ needs.create-release-tag.outputs.changie-latest }} | |
| files: ${{ env.MCPB_PACKAGE_NAME }} |