From 6109a9296e9d0c651be3fcca1ce05c0dda2ac424 Mon Sep 17 00:00:00 2001 From: Martin Fitzner <17951239+Scienfitz@users.noreply.github.com> Date: Fri, 1 Dec 2023 12:24:03 +0100 Subject: [PATCH 1/2] Create release.yml sine our meeting has moved later and thres not much more time for me to work on it today here already my proposal at the releas epipeline Ive tested triggers etc in my fork. PyPI upload actions have only been uncommented here. This pipe is safe to sue and will only fully work once we add the secrets --- .github/workflows/release.yml | 84 +++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..c827d5ce9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,84 @@ +name: Build & Publish Package + +on: + push: + tags: + - '*' + release: + types: + - published + +concurrency: + group: ${{ github.event_name }}_${{ github.ref_name }} + +jobs: + # Build and verify wheels + build: + name: Build & Verify Package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + - name: Create Wheel + run: | + pip install wheel + pip wheel . --no-deps --wheel-dir dist + ls -lat dist + - name: Check Wheel + shell: bash + run: | + pip install check-wheel-contents + check-wheel-contents dist/*.whl + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: Wheels_${{ github.ref_name }} + path: dist + + # Upload to Test PyPI on every tag + release-test-pypi: + needs: build + name: Publish PyPI TEST + environment: release-test-pypi + if: github.repository_owner == 'emdgroup' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + steps: + - name: Download packages built + uses: actions/download-artifact@v3 + with: + name: Wheels_${{ github.ref_name }} + path: dist + - name: Upload package to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + password: ${{ secrets.TEST_PYPI_TOKEN }} + + # Upload to real PyPI on GitHub Releases. + release-pypi: + needs: build + name: Publish PyPI PROD + environment: release-pypi + if: github.repository_owner == 'emdgroup' && github.event.action == 'published' + runs-on: ubuntu-latest + steps: + - uses: actions/setup-python@v4 + id: setup-python + with: + python-version: '3.11' + - name: Install test-package + run: | + pip install --index-url https://test.pypi.org/simple/ baybe + - name: Download packages built + uses: actions/download-artifact@v3 + with: + name: Wheels_${{ github.ref_name }} + path: dist + - name: Upload package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_TOKEN }} From 677f3b236a3f036f1ff05a6b4086a0d9cba90345 Mon Sep 17 00:00:00 2001 From: Martin Fitzner <17951239+Scienfitz@users.noreply.github.com> Date: Fri, 1 Dec 2023 12:25:15 +0100 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bac842646..6c1d2cf71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,13 +12,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Enabled passing optional arguments to `tox -e docs` calls - Logo and banner images - Project metadata to pyproject.toml +- PyPI release pipeline ### Changed - Reworked README for GitHub landing page - Now has concise contribution guidelines - Use Furo theme for documentation - ### Removed - `--debug` flag for documentation building