Skip to content

bump: version 0.2.3 → 0.3.1 #19

bump: version 0.2.3 → 0.3.1

bump: version 0.2.3 → 0.3.1 #19

Workflow file for this run

name: Release
"on":
push:
tags:
- "*"
jobs:
docker:
name: Build and push Docker image
if: ${{ ! contains(github.ref_name, 'dev') }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:${{ github.ref_name }}
pypi:
name: Build and publish package to PyPI
runs-on: ubuntu-latest
outputs:
brew_formula: ${{ steps.brew.outputs.formula }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
cache: pip
- name: Install Poetry
run: pip install poetry poetry-homebrew-formula
- name: Build and publish package
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry build
poetry publish
- name: Generate a Homebrew formula
id: brew
run: |
poetry remove psycopg-binary
poetry homebrew-formula --template=homebrew_formula.rb.j2
{
echo 'formula<<EOF'
cat dump-psql-roles-grants.rb
echo EOF
} | tee "$GITHUB_OUTPUT"
brew:
name: Update a brew formula at rgeraskin/homebrew
needs: pypi
runs-on: ubuntu-latest
steps:
- name: Checkout homebrew repository
uses: actions/checkout@v4
with:
repository: rgeraskin/homebrew-homebrew
token: ${{ secrets.GH_TOKEN_HOMEBREW }}
- name: Commit and push formula
env:
BREW_FORMULA: ${{ needs.pypi.outputs.brew_formula }}
run: |
echo "$BREW_FORMULA" > Formula/dump-psql-roles-grants.rb
git config user.name github-actions
git config user.email [email protected]
git add Formula/dump-psql-roles-grants.rb
git commit -m "Bump: dump-psql-roles-grants to ${{ github.ref_name }}"
git push
release:
name: Create GitHub release
if: ${{ ! contains(github.ref_name, 'dev') }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
cache: pip
- name: Install Commitizen
run: |
pip install commitizen
- name: Generate Changelog
run: |
git fetch --tags
echo Changes in this Release: | tee release_notes
cz changelog --dry-run ${{ github.ref_name }} | tail -n +2 | tee -a release_notes
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: release_notes