Fixes ci pip install typo (#78) #41
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
name: Test & Release | |
concurrency: | |
group: django-squash-release-${{ github.head_ref }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
django-squash: | |
uses: ./.github/workflows/_tests.yml | |
secrets: inherit | |
with: | |
ref: ${{ github.ref }} | |
pypi-publish: | |
name: Tag and Release | |
runs-on: ubuntu-latest | |
environment: deploy | |
needs: django-squash | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Install pypa/build | |
run: python3 -m pip install build setuptools | |
- name: Build a binary wheel and a source tarball | |
run: python3 -m build | |
- name: Extract django-squash version | |
run: | | |
SQUASH_VERSION=$(python3 setup.py --version) | |
echo "SQUASH_VERSION=$SQUASH_VERSION" >> "$GITHUB_ENV" | |
- name: Package version has corresponding git tag | |
id: tagged | |
shell: bash | |
run: | | |
git fetch --tags | |
(git show-ref --tags --verify --quiet -- "refs/tags/v$SQUASH_VERSION" && echo "tagged=1" || echo "tagged=0") >> $GITHUB_OUTPUT | |
- name: Create tags | |
if: steps.tagged.outputs.tagged == 0 | |
run: | | |
git tag v$SQUASH_VERSION | |
git push origin v$SQUASH_VERSION | |
- name: Publish distribution 📦 to PyPI | |
if: steps.tagged.outputs.tagged == 0 | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
verbose: true | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |