From def0ac4cdff7e714a78579377ce15bfabcf1684b Mon Sep 17 00:00:00 2001 From: Joseph McKinsey Date: Fri, 7 Jun 2024 11:35:39 -0600 Subject: [PATCH] Rename and create cd --- .github/workflows/cd-cli-extras.yml | 70 +++++++++++++++++++ .../{ci-cli.yml => ci-cli-extras.yml} | 0 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/cd-cli-extras.yml rename .github/workflows/{ci-cli.yml => ci-cli-extras.yml} (100%) diff --git a/.github/workflows/cd-cli-extras.yml b/.github/workflows/cd-cli-extras.yml new file mode 100644 index 0000000..db643c0 --- /dev/null +++ b/.github/workflows/cd-cli-extras.yml @@ -0,0 +1,70 @@ +name: CD - CLI Extras + +on: + push: + branches: + - main + tags: + - v* + +jobs: + build-wheels: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + + - name: Set up Python3 + uses: actions/setup-python@v5 + with: + python-version: 3.8 + + - name: Install python3 dependencies + run: | + python -m pip install -U pip install wheel setuptools cffi build + - name: Build cli_extras wheel + run: | + cd helics_cli_extras + python -m build + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: python-dist + path: helics_cli_extras/dist/* + + publish-helics: + needs: [build-wheels] + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/helics-cli-extras + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + - name: Get the built packages + uses: actions/download-artifact@v4 + with: + merge-multiple: true + path: dist + + - name: Publish package to TestPyPI + if: startsWith(github.ref, 'refs/tags/') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_PASSWORD }} + repository-url: https://test.pypi.org/legacy/ + + - name: Publish package to PyPI + if: startsWith(github.ref, 'refs/tags/') + uses: pypa/gh-action-pypi-publish@release/v1 + + - name: GitHub Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v2 + with: + files: "dist/*" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci-cli.yml b/.github/workflows/ci-cli-extras.yml similarity index 100% rename from .github/workflows/ci-cli.yml rename to .github/workflows/ci-cli-extras.yml