Release v0.20.0a1 #24
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*'] | |
| env: | |
| REGISTRY: quay.io/bbrowning | |
| PLATFORMS: linux/amd64,linux/arm64 | |
| jobs: | |
| lint: | |
| name: Lint & Type Check | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: "3.11" | |
| - name: Run linter | |
| run: make lint | |
| - name: Run type checker | |
| run: make typecheck | |
| test: | |
| name: Unit Tests | |
| needs: lint | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Run unit tests | |
| run: make test | |
| publish-containers: | |
| name: Publish ${{ matrix.image.name }} | |
| needs: test | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| image: | |
| - name: paude-base-centos10 | |
| context: ./containers/paude | |
| - name: paude-proxy-centos10 | |
| context: ./containers/proxy | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up QEMU for multi-arch builds | |
| run: sudo apt-get update && sudo apt-get install -y qemu-user-static | |
| - name: Extract version from tag | |
| id: version | |
| run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" | |
| - name: Log in to Quay.io | |
| run: podman login -u "${{ secrets.QUAY_USERNAME }}" -p "${{ secrets.QUAY_PASSWORD }}" quay.io | |
| - name: Check if pre-release | |
| id: prerelease | |
| run: | | |
| if echo "${GITHUB_REF_NAME}" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+$'; then | |
| echo "is_prerelease=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "is_prerelease=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Build and push image | |
| env: | |
| VERSION: ${{ steps.version.outputs.version }} | |
| IMAGE: ${{ matrix.image.name }} | |
| CONTEXT: ${{ matrix.image.context }} | |
| IS_PRERELEASE: ${{ steps.prerelease.outputs.is_prerelease }} | |
| run: | | |
| FULL="${REGISTRY}/${IMAGE}:${VERSION}" | |
| # Build multi-arch manifest and push versioned tag | |
| podman manifest create "${FULL}" | |
| podman build --platform "${PLATFORMS}" --manifest "${FULL}" "${CONTEXT}" | |
| podman manifest push --all "${FULL}" "${FULL}" | |
| # Only update latest for stable releases | |
| if [ "${IS_PRERELEASE}" = "false" ]; then | |
| LATEST="${REGISTRY}/${IMAGE}:latest" | |
| podman manifest push --all "${FULL}" "${LATEST}" | |
| else | |
| echo "Skipping latest tag for pre-release ${VERSION}" | |
| fi | |
| publish-pypi: | |
| name: Publish to PyPI | |
| needs: [test, publish-containers] | |
| runs-on: ubuntu-22.04 | |
| environment: pypi | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: "3.11" | |
| - name: Build package | |
| run: uv build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| github-release: | |
| name: Create GitHub Release | |
| needs: [publish-containers, publish-pypi] | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check if pre-release | |
| id: prerelease | |
| run: | | |
| if echo "${GITHUB_REF_NAME}" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+$'; then | |
| echo "is_prerelease=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "is_prerelease=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Generate release notes | |
| run: | | |
| PREV_TAG=$(git tag --sort=-version:refname | grep '^v' | sed -n '2p') | |
| if [ -n "${PREV_TAG}" ]; then | |
| echo "Generating notes from ${PREV_TAG} to ${GITHUB_REF_NAME}" | |
| git log --pretty=format:"- %s" "${PREV_TAG}..${GITHUB_REF_NAME}" \ | |
| | grep -v "^- Release v" > /tmp/release-notes.txt | |
| else | |
| echo "No previous tag found, using all commits" | |
| git log --pretty=format:"- %s" "${GITHUB_REF_NAME}" \ | |
| | grep -v "^- Release v" > /tmp/release-notes.txt | |
| fi | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| PRERELEASE_FLAG="" | |
| if [ "${{ steps.prerelease.outputs.is_prerelease }}" = "true" ]; then | |
| PRERELEASE_FLAG="--prerelease" | |
| fi | |
| gh release create "${GITHUB_REF_NAME}" \ | |
| --title "${GITHUB_REF_NAME}" \ | |
| --notes-file /tmp/release-notes.txt \ | |
| ${PRERELEASE_FLAG} |