chore(main): release 1.8.0 #200
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: 1. Release-Please | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| release-please: | |
| runs-on: ubuntu-latest | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: googleapis/release-please-action@v4 | |
| id: release | |
| with: | |
| release-type: python | |
| token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} | |
| - name: Debug release outputs | |
| run: | | |
| echo "release_created=${{ steps.release.outputs.release_created }}" | |
| echo "version=${{ steps.release.outputs.version }}" | |
| echo "tag_name=${{ steps.release.outputs.tag_name }}" | |
| echo "upload_url=${{ steps.release.outputs.upload_url }}" | |
| - name: Checkout code | |
| uses: actions/checkout@v4.2.1 | |
| - name: last release tag | |
| id: get_last_release | |
| run: | | |
| LAST_RELEASE_TAG=$(gh release list --limit 2 --json tagName -q '.[1].tagName') | |
| echo "last_release=$LAST_RELEASE_TAG" | |
| echo "last_release=$LAST_RELEASE_TAG" >> $GITHUB_OUTPUT | |
| - name: Set up Python | |
| if: ${{ steps.release.outputs.release_created }} | |
| uses: actions/setup-python@v5.2.0 | |
| with: | |
| python-version: 3.x | |
| - name: Install Poetry | |
| if: ${{ steps.release.outputs.release_created }} | |
| run: | | |
| pip install poetry | |
| poetry config virtualenvs.create false # Skip creating a virtual environment | |
| env: | |
| POETRY_HOME: ${{ github.workspace }}/.poetry | |
| - name: Install project dependencies | |
| if: ${{ steps.release.outputs.release_created }} | |
| run: poetry install | |
| env: | |
| POETRY_HOME: ${{ github.workspace }}/.poetry | |
| - name: Build package | |
| if: ${{ steps.release.outputs.release_created }} | |
| run: poetry build | |
| env: | |
| POETRY_HOME: ${{ github.workspace }}/.poetry | |
| - name: Append custom release notes | |
| if: ${{ steps.release.outputs.release_created }} | |
| run: | | |
| release_id=$(gh api \ | |
| -H "Accept: application/vnd.github+json" \ | |
| /repos/${{ github.repository }}/releases/tags/${{ steps.release.outputs.tag_name }} \ | |
| --jq .id) | |
| # Fetch existing release body | |
| existing_body=$(gh api /repos/${{ github.repository }}/releases/$release_id --jq .body) | |
| # Create temporary file for new body | |
| tmpfile=$(mktemp) | |
| # Write combined content into the file | |
| { | |
| echo "$existing_body" | |
| echo | |
| echo "Install as package using:" | |
| echo '```bash' | |
| echo "pip install git+https://github.com/bensteUEM/ChurchToolsAPI.git@${{ steps.release.outputs.version }}#egg=churchtools-api" | |
| echo '```' | |
| echo "**Full Changelog**: https://github.com/bensteUEM/ChurchToolsAPI/compare/${{ steps.get_last_release.outputs.last_release }}...$${{ steps.release.outputs.tag_name }}" | |
| } > "$tmpfile" | |
| # Update the release body using the file | |
| gh api \ | |
| -X PATCH \ | |
| -H "Accept: application/vnd.github+json" \ | |
| /repos/${{ github.repository }}/releases/$release_id \ | |
| -F body="$(cat "$tmpfile")" | |
| - name: Upload Release Artifact | |
| if: ${{ steps.release.outputs.release_created }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: gh release upload ${{ steps.release.outputs.tag_name }} dist/* |