docs: example provider tests - message #868
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: build cli | |
| on: | |
| push: | |
| tags: | |
| - pact-python-cli/* | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| env: | |
| STABLE_PYTHON_VERSION: '310' | |
| HATCH_VERBOSE: '1' | |
| FORCE_COLOR: '1' | |
| CIBW_BUILD_FRONTEND: build | |
| jobs: | |
| complete: | |
| name: Build CLI completion check | |
| if: always() | |
| permissions: | |
| contents: none | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build-sdist | |
| - build-wheels | |
| - publish | |
| steps: | |
| - name: Failed | |
| run: exit 1 | |
| if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') | |
| build-sdist: | |
| name: Build CLI source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 | |
| with: | |
| enable-cache: true | |
| - name: Install Python | |
| run: uv python install ${{ env.STABLE_PYTHON_VERSION }} | |
| - name: Install hatch | |
| run: uv tool install hatch | |
| - name: Create source distribution | |
| working-directory: pact-python-cli | |
| run: hatch build --target sdist | |
| - name: Upload sdist | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: wheels-sdist | |
| path: pact-python-cli/dist/*.tar* | |
| if-no-files-found: error | |
| compression-level: 0 | |
| build-wheels: | |
| name: Build CLI wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: macos-15-intel | |
| - os: macos-latest | |
| - os: ubuntu-24.04-arm | |
| - os: ubuntu-latest | |
| # - os: windows-11-arm # Not supported upstream | |
| - os: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Create wheels | |
| uses: pypa/cibuildwheel@63fd63b352a9a8bdcc24791c9dbee952ee9a8abc # v3.3.0 | |
| with: | |
| package-dir: pact-python-cli | |
| env: | |
| CIBW_BUILD: cp${{ env.STABLE_PYTHON_VERSION }}-* | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: wheels-${{ matrix.os }} | |
| path: wheelhouse/*.whl | |
| if-no-files-found: error | |
| compression-level: 0 | |
| publish: | |
| name: Publish CLI wheels and sdist | |
| if: >- | |
| github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/pact-python-cli/') | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/pact-python-cli | |
| needs: | |
| - build-sdist | |
| - build-wheels | |
| permissions: | |
| # Required for creating the release | |
| contents: write | |
| # Required for trusted publishing | |
| id-token: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install git cliff and typos | |
| uses: taiki-e/install-action@61e5998d108b2b55a81b9b386c18bd46e4237e4f # v2.63.1 | |
| with: | |
| tool: git-cliff,typos | |
| - name: Update changelog | |
| run: git cliff --verbose | |
| working-directory: pact-python-cli | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
| - name: Generate release changelog | |
| id: release-changelog | |
| working-directory: pact-python-cli | |
| run: | | |
| if ! git cliff \ | |
| --current \ | |
| --strip header \ | |
| --output ${{ runner.temp }}/release-changelog.md; then | |
| { | |
| echo "> [!WARNING]" | |
| echo ">" | |
| echo "> No changelog generated. To be filled in." | |
| } > ${{ runner.temp }}/release-changelog.md | |
| fi | |
| { | |
| echo "" | |
| echo "<details>" | |
| echo "<summary>" | |
| echo "" | |
| echo "## Pull Requests" | |
| echo "" | |
| echo "</summary>" | |
| echo "" | |
| } >> ${{ runner.temp }}/release-changelog.md | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
| - name: Download wheels and sdist | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | |
| with: | |
| path: wheelhouse | |
| merge-multiple: true | |
| - name: Generate release | |
| id: release | |
| uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0 | |
| with: | |
| files: wheelhouse/* | |
| body_path: ${{ runner.temp }}/release-changelog.md | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| - name: Push build artifacts to PyPI | |
| uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 | |
| with: | |
| skip-existing: true | |
| packages-dir: wheelhouse | |
| - name: Create PR for changelog update | |
| uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0 | |
| with: | |
| token: ${{ secrets.GH_TOKEN }} | |
| commit-message: 'docs: update changelog for ${{ github.ref_name }}' | |
| title: 'docs: update cli changelog' | |
| body: | | |
| This PR updates the changelog for ${{ github.ref_name }}. | |
| branch: docs/update-changelog | |
| base: main |