Merge pull request #370 from mollie/release-3.7.4 #35
Workflow file for this run
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: Create and publish package | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
pre-build-checks: | |
name: Pre-build checks | |
uses: ./.github/workflows/tests.yaml | |
build: | |
name: Build package | |
runs-on: ubuntu-latest | |
needs: pre-build-checks | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install --upgrade build | |
- name: Build packages | |
run: python -m build | |
- name: Save artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: packages-${{ github.ref_name }} | |
path: dist/* | |
pypi-release: | |
name: Upload packages to PyPi | |
needs: build | |
runs-on: ubuntu-latest | |
if: ${{ !contains(github.ref_name, 'dev')}} # Ignore dev releases | |
steps: | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install --upgrade twine | |
- name: Download artifacts | |
uses: actions/[email protected] | |
with: | |
name: packages-${{ github.ref_name }} | |
path: dist/ | |
- name: Upload packages | |
run: python -m twine upload dist/* | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
github-release: | |
name: Create release on Github | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get packages | |
uses: actions/[email protected] | |
with: | |
name: packages-${{ github.ref_name }} | |
path: dist/ | |
- name: Create new release | |
continue-on-error: true # If this fails, we can do it by hand | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} # Provided by github actions, no need to configure | |
tag: ${{ github.ref_name }} | |
name: ${{ github.ref_name }} | |
body: | | |
Summary: | |
- TODO | |
Install it: https://pypi.org/project/mollie-api-python/${{ github.ref_name }} | |
draft: true | |
artifacts: dist/* |