chore(main): release 1.0.0 (#64) #67
This file contains 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
on: | |
push: | |
branches: | |
- main | |
name: release-please | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
environment: production-pypi | |
steps: | |
- uses: google-github-actions/release-please-action@v3 | |
id: release | |
with: | |
release-type: python | |
package-name: django-htmx-autocomplete | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v4 | |
if: ${{ steps.release.outputs.release_created }} | |
with: | |
python-version: '3.10' | |
- name: Install language dependencies | |
run: | | |
sudo apt-get install -y gettext | |
- name: Build source and wheel distributions | |
if: ${{ steps.release.outputs.release_created }} | |
run: | | |
python -m pip install --upgrade build twine | |
python -m build | |
twine check --strict dist/* | |
- name: Publish distribution to PyPI | |
if: ${{ steps.release.outputs.release_created }} | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
- name: Upload Release Assets 1/2 | |
if: ${{ steps.release.outputs.release_created }} | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.release.outputs.upload_url }} | |
asset_path: ./dist/django-htmx-autocomplete-${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}.tar.gz | |
asset_name: django-htmx-autocomplete-${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}.tar.gz | |
asset_content_type: application/gzip | |
- name: Upload Release Assets 2/2 | |
if: ${{ steps.release.outputs.release_created }} | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.release.outputs.upload_url }} | |
asset_path: ./dist/django_htmx_autocomplete-${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}-py3-none-any.whl | |
asset_name: django_htmx_autocomplete-${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}-py3-none-any.whl | |
asset_content_type: application/x-wheel+zip | |
- name: tag major and minor versions | |
if: ${{ steps.release.outputs.release_created }} | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git" | |
git tag -d v${{ steps.release.outputs.major }} || true | |
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true | |
git push origin :v${{ steps.release.outputs.major }} || true | |
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true | |
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}" | |
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}" | |
git push origin v${{ steps.release.outputs.major }} | |
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} |