Skip to content

Commit

Permalink
Merge pull request #15 from uktrade/ci/deploy-to-pypi
Browse files Browse the repository at this point in the history
ci: workflow to deploy to PyPI
  • Loading branch information
michalc committed Aug 19, 2023
2 parents 8de8cf8 + 3b10f50 commit f951132
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/deploy-package-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy package to PyPI

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v3
with:
python-version: 3.11

- name: Update version in pyproject.toml from current git tag
run: >-
sed -i "s/0\\.0\\.0\\.dev0/${GITHUB_REF/refs\/tags\/v/}/g" pyproject.toml
- run: |
pip install build
python -m build
- uses: actions/upload-artifact@v3
with:
path: ./dist

deploy:
needs: [build]
environment:
name: pypi
url: https://pypi.org/project/stream-zip/

name: upload release to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: artifact/
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "mirror-git-to-s3"
version = "0.0.21"
version = "0.0.0.dev0"
authors = [
{ name="Department for International Trade", email="sre@digital.trade.gov.uk" },
]
Expand Down

0 comments on commit f951132

Please sign in to comment.