diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..606532e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,35 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Test, Build, and Publish + +on: + workflow_dispatch: + release: + types: [ published ] + +permissions: + contents: read + id-token: write + +jobs: + test_build_and_publish: + if: github.repository == 'JamesHutchison/megamock' + runs-on: ubuntu-latest + environment: production + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Setup Poetry + # You may pin to the exact commit or the version. + uses: Gr1N/setup-poetry@12c727a3dcf8c1a548d8d041c9d5ef5cebb3ba2e + - name: test + uses: ./.github/actions/test + - name: Build distributions + run: | + poetry build + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1