Skip to content

feat: implement proper version control in requirements.txt #96

feat: implement proper version control in requirements.txt

feat: implement proper version control in requirements.txt #96

Workflow file for this run

# This workflow will publish a package to both TestPyPi and PyPi when a release is created
name: Test & Build & Publish to Pypi
on:
push:
branches: [ master ]
jobs:
test:
if: contains(github.event.head_commit.message, 'chore(release)')
uses: ./.github/workflows/test.yml
build:
needs: test
if: contains(github.event.head_commit.message, 'chore(release)')
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.12'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python -m build
- name: Store the distribution packages
uses: actions/[email protected]
with:
name: python-package-distributions
path: dist/
publish-to-test-pypi:
name: >-
Publish to Test PyPI
needs: build
if: contains(github.event.head_commit.message, 'chore(release)')
runs-on: ubuntu-22.04
environment:
name: testpypi
url: https://test.pypi.org/p/buttercms-python-testing-fork
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/[email protected]
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1.8
with:
repository-url: https://test.pypi.org/legacy/