From b872a9f2a1bc0e0d4e0351a2b3bade2ef5eb911b Mon Sep 17 00:00:00 2001 From: Martin Styk Date: Sat, 30 Dec 2023 17:01:41 +0100 Subject: [PATCH] Rework release pipeline Signed-off-by: Martin Styk --- .github/workflows/publish-pypi.yml | 49 ------------------------- .github/workflows/publish.yml | 59 ++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 49 deletions(-) delete mode 100644 .github/workflows/publish-pypi.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml deleted file mode 100644 index b37c5b3b6..000000000 --- a/.github/workflows/publish-pypi.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Upload Beaker packages to PyPI - -on: - release: - types: [created] - -jobs: - deploy-client-package: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_BKR_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_BKR_CLIENT_PASSWORD }} - run: | - cd Client - python setup.py sdist bdist_wheel - twine upload dist/* - - deploy-common-package: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_BKR_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_BKR_COMMON_PASSWORD }} - run: | - cd Common - python setup.py sdist bdist_wheel - twine upload dist/* - diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..b87aa9bb7 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,59 @@ +name: Publish + +on: [pull_request] + + +jobs: + create-python-package: + strategy: + matrix: + component: ["Common", "Client"] + runs-on: ubuntu-latest + outputs: + hash: ${{ steps.hash.outputs.hash }} + steps: + - name: Checkout source code + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install python dependencies + run: pip install --upgrade pip && pip install build + - name: Build python package + run: cd Client && python -m build + - name: Generate hash + id: hash + run: cd Client/dist && echo "hash=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT + - name: Upload python artifacts + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 + with: + path: Client/dist + + +# +# pypi-publish-common: +# name: Upload beaker-common release to PyPI +# runs-on: ubuntu-latest +# environment: production +# permissions: +# id-token: write +# steps: +# - +# - name: Publish package distributions to PyPI +# uses: pypa/gh-action-pypi-publish@release/v1 +# with: +# packages-dir: artifacts/ +# +# pypi-publish-client: +# name: Upload beaker-client release to PyPI +# runs-on: ubuntu-latest +# environment: production +# permissions: +# id-token: write +# steps: +# - +# - name: Publish package distributions to PyPI +# uses: pypa/gh-action-pypi-publish@release/v1 +# with: +# packages-dir: artifacts/