From b89286cdc0a1b7fc087d43243e9087eed45c19ea Mon Sep 17 00:00:00 2001 From: Yves Bastide Date: Sat, 16 Sep 2023 19:30:13 +0200 Subject: [PATCH] ci: test uploading to test.pypi.org Signed-off-by: Yves Bastide --- .github/workflows/build.yaml | 17 ++++++++++++++ .github/workflows/test-release.yaml | 35 +++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/test-release.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..711ab005d --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,17 @@ +name: "Build simpleflow" + +on: + release: + types: + - created + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: python setup.py sdist bdist_wheel + - uses: actions/upload-artifact@v3 + with: + name: simpleflow + path: dist diff --git a/.github/workflows/test-release.yaml b/.github/workflows/test-release.yaml new file mode 100644 index 000000000..ef5240c97 --- /dev/null +++ b/.github/workflows/test-release.yaml @@ -0,0 +1,35 @@ +name: "Publish release to TestPyPI" + +on: + workflow_run: + workflows: + - build + types: + - completed + branches: + - main + +jobs: + publish-testpypi: + name: Upload release to TestPyPI + if: ${{ github.event.workflow_run.conclusion == 'success' }} +# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + environment: + name: test-release + url: https://test.pypi.org/p/simpleflow + permissions: + id-token: write + steps: + - uses: actions/checkout@v3 + + - uses: actions/download-artifact@v3 + with: + name: simpleflow + + - name: Publish package distributions to TestPyPI + uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e + with: + repository-url: https://test.pypi.org/legacy/ + verbose: true + print-hash: true