From 72817a097464e37c8d5a8636db4dcceceaee67e2 Mon Sep 17 00:00:00 2001 From: rturrado <68099809+rturrado@users.noreply.github.com> Date: Mon, 8 Jan 2024 11:23:52 +0100 Subject: [PATCH 1/8] - Fix `upload-release-asset` steps in `assets.yml`. - Update `RELEASE.md`. --- .github/workflows/assets.yml | 44 +++++++++++++++++++------------ CHANGELOG.md | 11 ++++++++ RELEASE.md | 50 +++++++++++++++++------------------- include/version.hpp | 4 +-- 4 files changed, 65 insertions(+), 44 deletions(-) diff --git a/.github/workflows/assets.yml b/.github/workflows/assets.yml index 41efe354..7a60a783 100644 --- a/.github/workflows/assets.yml +++ b/.github/workflows/assets.yml @@ -37,19 +37,22 @@ jobs: - name: Wheel path id: wheel working-directory: pybuild/dist/ - run: echo "{wheel}={$(ls *.whl)}" >> $GITHUB_OUTPUT + run: echo "{WHEEL_NAME}={$(ls *.whl)}" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@v3 + env: + WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: name: pypi-macos-py${{ matrix.python }} - path: pybuild/dist/${{ steps.wheel.outputs.wheel }} + path: pybuild/dist/$WHEEL_NAME - uses: actions/upload-release-asset@v1 if: ${{ github.event_name == 'release' && github.event.action == 'created' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: pybuild/dist/${{ steps.wheel.outputs.wheel }} - asset_name: ${{ steps.wheel.outputs.wheel }} + asset_path: pybuild/dist/$WHEEL_NAME + asset_name: $WHEEL_NAME asset_content_type: application/zip manylinux-x64: @@ -88,19 +91,22 @@ jobs: - name: Wheel path id: wheel working-directory: wheelhouse - run: echo "{wheel}={$(ls *.whl)}" >> $GITHUB_OUTPUT + run: echo "{WHEEL_NAME}={$(ls *.whl)}" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@v3 + env: + WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: name: pypi-linux-${{ matrix.cpython_version }} - path: wheelhouse/${{ steps.wheel.outputs.wheel }} + path: wheelhouse/$WHEEL_NAME - uses: actions/upload-release-asset@v1 if: ${{ github.event_name == 'release' && github.event.action == 'created' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: wheelhouse/${{ steps.wheel.outputs.wheel }} - asset_name: ${{ steps.wheel.outputs.wheel }} + asset_path: wheelhouse/$WHEEL_NAME + asset_name: $WHEEL_NAME asset_content_type: application/zip manylinux-arm64: @@ -151,19 +157,22 @@ jobs: - name: Wheel path id: wheel working-directory: wheelhouse - run: echo "{wheel}={$(ls *.whl)}" >> $GITHUB_OUTPUT + run: echo "{WHEEL_NAME}={$(ls *.whl)}" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@v3 + env: + WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: name: pypi-linux-${{ matrix.cpython_version }} - path: wheelhouse/${{ steps.wheel.outputs.wheel }} + path: wheelhouse/$WHEEL_NAME - uses: actions/upload-release-asset@v1 if: ${{ github.event_name == 'release' && github.event.action == 'created' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: wheelhouse/${{ steps.wheel.outputs.wheel }} - asset_name: ${{ steps.wheel.outputs.wheel }} + asset_path: wheelhouse/$WHEEL_NAME + asset_name: $WHEEL_NAME asset_content_type: application/zip windows-x64: @@ -190,19 +199,22 @@ jobs: - name: Wheel path id: wheel working-directory: pybuild/dist/ - run: echo "{wheel}={$(Get-ChildItem -name *.whl)}" >> $GITHUB_OUTPUT + run: echo "{WHEEL_NAME}={$(Get-ChildItem -name *.whl)}" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@v3 + env: + WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: name: pypi-windows-py${{ matrix.python }} - path: pybuild/dist/${{ steps.wheel.outputs.wheel }} + path: pybuild/dist/$WHEEL_NAME - uses: actions/upload-release-asset@v1 if: ${{ github.event_name == 'release' && github.event.action == 'created' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: pybuild/dist/${{ steps.wheel.outputs.wheel }} - asset_name: ${{ steps.wheel.outputs.wheel }} + asset_path: pybuild/dist/$WHEEL_NAME + asset_name: $WHEEL_NAME asset_content_type: application/zip publish: diff --git a/CHANGELOG.md b/CHANGELOG.md index 154561b4..18d3303e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [ 0.5.1 ] - [ 2024-01-08 ] + +### Added + +### Changed + +- Fixed `upload-release-asset` steps in `.github/workflow/assets.yml`. +- Updated `RELEASE.md`. + +### Removed + ## [ 0.5.0 ] - [ 2023-12-16 ] ### Added diff --git a/RELEASE.md b/RELEASE.md index e3c57236..cbecd56a 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -2,40 +2,38 @@ Release procedure ================= Most of the release process is managed by GitHub Actions. If you follow the -procedure below, it will automatically test and build all wheels and conda -packages for all platform, and publish them to PyPI and conda assuming the -secrets are configured correctly. +procedure below, it will automatically test and build all wheels for all platforms, +and publish them to PyPI assuming the secrets are configured correctly. - - Make a branch with a name starting with "release" based upon the commit that - is to be released. For example, `release-0.0.1`, but the suffix doesn't - matter. + - Make a branch with a name starting with "release" based upon the commit that is to be released. + For example, `release-0.0.1`, but the suffix doesn't matter. - - Change the version in `setup.py` (this is the only place where the version - is hardcoded) and change any other files where applicable (changelog, etc), - then commit and make a PR for it. + - Change the version in `include/version.hpp` (this is the only place where the version is hardcoded) + and change any other files where applicable (`CHANGELOG.md`, etc), then commit and make a PR for it. - CI will now run not only the test workflow, but also the assets workflow. - The assets workflow builds the wheels and conda packages, but publishes them - to the GitHub Actions build artifacts only. You can then test these yourself - if you have reason to believe that something might be wrong with them that - CI might not catch. To find them, go to Actions -> Assets workflow -> - click the run for your branch -> Artifacts. + The assets workflow builds the wheels, but publishes them to the GitHub Actions build artifacts only. + You can then test these yourself if you have reason to believe that + something might be wrong with them that CI might not catch. + To find them, go to Actions -> Assets workflow -> click the run for your branch -> Artifacts. - - If the test or assets workflows fail, fix it before merging the PR (of - course). + - If the test or assets workflows fail, fix it before merging the PR (of course). - Once CI is green, merge the PR into `develop` if there are any changes. If no changes were needed, just delete the branch to clean up. - - If needed, also merge to `master`. + - Create and push a new tag using the same version you put in `include/version.hpp`. + For example: - - Draft a new release through the GitHub interface. Set the "tag version" - to the same version you put in `setup.py`, the title to - "Release `version`: `name`", and write a short changelog in the body. - For releases that don't go to master, check the "prerelease" box, so it - won't show up as the latest release. + ``` + git tag 0.0.1 + git push origin 0.0.1 + ``` - - CI will run the assets workflow again, now with the new version string baked - into the wheels and packages. When done, these wheels and packages are - automatically added to the GitHub release, and if the secrets/API keys for - PyPI and conda are correct, CI will publish them there. + - Draft a new release through the GitHub interface. + Set the "tag version", and the title to "Release `version`: `name`". + And write a short change log in the body. + + - CI will run the assets workflow again, now with the new version string baked into the wheels. + When done, these wheels are automatically added to the GitHub release, + and if the secrets/API keys for PyPI are correct, CI will publish them there. diff --git a/include/version.hpp b/include/version.hpp index 25737a46..597208d3 100644 --- a/include/version.hpp +++ b/include/version.hpp @@ -1,4 +1,4 @@ #pragma once -#define LIBQASM_VERSION "0.5.0" -#define LIBQASM_RELEASE_YEAR "2023" +#define LIBQASM_VERSION "0.5.1" +#define LIBQASM_RELEASE_YEAR "2024" From 320d5f6c6d1f07db2db98147f200045c392baec4 Mon Sep 17 00:00:00 2001 From: rturrado <68099809+rturrado@users.noreply.github.com> Date: Mon, 8 Jan 2024 11:40:15 +0100 Subject: [PATCH 2/8] Trying to set WHEEL_NAME correctly. --- .github/workflows/assets.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/assets.yml b/.github/workflows/assets.yml index 7a60a783..771cfeed 100644 --- a/.github/workflows/assets.yml +++ b/.github/workflows/assets.yml @@ -37,7 +37,7 @@ jobs: - name: Wheel path id: wheel working-directory: pybuild/dist/ - run: echo "{WHEEL_NAME}={$(ls *.whl)}" >> $GITHUB_OUTPUT + run: echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@v3 env: WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} @@ -91,7 +91,7 @@ jobs: - name: Wheel path id: wheel working-directory: wheelhouse - run: echo "{WHEEL_NAME}={$(ls *.whl)}" >> $GITHUB_OUTPUT + run: echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@v3 env: WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} @@ -157,7 +157,7 @@ jobs: - name: Wheel path id: wheel working-directory: wheelhouse - run: echo "{WHEEL_NAME}={$(ls *.whl)}" >> $GITHUB_OUTPUT + run: echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@v3 env: WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} @@ -199,7 +199,7 @@ jobs: - name: Wheel path id: wheel working-directory: pybuild/dist/ - run: echo "{WHEEL_NAME}={$(Get-ChildItem -name *.whl)}" >> $GITHUB_OUTPUT + run: echo "WHEEL_NAME=$(Get-ChildItem -name *.whl)" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@v3 env: WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} From a7fc8944bfeb923902a9781227a177ade39a1927 Mon Sep 17 00:00:00 2001 From: rturrado <68099809+rturrado@users.noreply.github.com> Date: Mon, 8 Jan 2024 12:26:22 +0100 Subject: [PATCH 3/8] WHEEL_NAME is not being found, or is set to empty. --- .github/workflows/assets.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/assets.yml b/.github/workflows/assets.yml index 771cfeed..c86c2195 100644 --- a/.github/workflows/assets.yml +++ b/.github/workflows/assets.yml @@ -37,7 +37,9 @@ jobs: - name: Wheel path id: wheel working-directory: pybuild/dist/ - run: echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_OUTPUT + run: | + echo "WHEEL_NAME=$(ls *.whl)" + echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@v3 env: WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} @@ -91,7 +93,9 @@ jobs: - name: Wheel path id: wheel working-directory: wheelhouse - run: echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_OUTPUT + run: | + echo "WHEEL_NAME=$(ls *.whl)" + echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@v3 env: WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} @@ -157,7 +161,9 @@ jobs: - name: Wheel path id: wheel working-directory: wheelhouse - run: echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_OUTPUT + run: | + echo "WHEEL_NAME=$(ls *.whl)" + echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@v3 env: WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} @@ -199,7 +205,9 @@ jobs: - name: Wheel path id: wheel working-directory: pybuild/dist/ - run: echo "WHEEL_NAME=$(Get-ChildItem -name *.whl)" >> $GITHUB_OUTPUT + run: | + echo "WHEEL_NAME=$(Get-ChildItem -name *.whl)" + echo "WHEEL_NAME=$(Get-ChildItem -name *.whl)" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@v3 env: WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} From dbf7f3fc71be15d6f9d124cc410733ba6bf07742 Mon Sep 17 00:00:00 2001 From: rturrado <68099809+rturrado@users.noreply.github.com> Date: Mon, 8 Jan 2024 15:22:49 +0100 Subject: [PATCH 4/8] WHEEL_NAME is set correctly, but still retrieved as blank. --- .github/workflows/assets.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/assets.yml b/.github/workflows/assets.yml index c86c2195..d7c6a4c0 100644 --- a/.github/workflows/assets.yml +++ b/.github/workflows/assets.yml @@ -29,8 +29,8 @@ jobs: - name: Install dependencies run: | brew install bison flex - echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH - echo "/usr/local/opt/flex/bin" >> $GITHUB_PATH + echo "/usr/local/opt/bison/bin" >> "$GITHUB_PATH" + echo "/usr/local/opt/flex/bin" >> "$GITHUB_PATH" python -m pip install --upgrade pip conan setuptools wheel - name: Build wheel run: python setup.py bdist_wheel @@ -39,13 +39,13 @@ jobs: working-directory: pybuild/dist/ run: | echo "WHEEL_NAME=$(ls *.whl)" - echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_OUTPUT + echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_OUTPUT" - uses: actions/upload-artifact@v3 env: WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: name: pypi-macos-py${{ matrix.python }} - path: pybuild/dist/$WHEEL_NAME + path: "pybuild/dist/$WHEEL_NAME" - uses: actions/upload-release-asset@v1 if: ${{ github.event_name == 'release' && github.event.action == 'created' }} env: @@ -53,8 +53,8 @@ jobs: WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: pybuild/dist/$WHEEL_NAME - asset_name: $WHEEL_NAME + asset_path: "pybuild/dist/$WHEEL_NAME" + asset_name: "$WHEEL_NAME" asset_content_type: application/zip manylinux-x64: @@ -95,13 +95,13 @@ jobs: working-directory: wheelhouse run: | echo "WHEEL_NAME=$(ls *.whl)" - echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_OUTPUT + echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_OUTPUT" - uses: actions/upload-artifact@v3 env: WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: name: pypi-linux-${{ matrix.cpython_version }} - path: wheelhouse/$WHEEL_NAME + path: "wheelhouse/$WHEEL_NAME" - uses: actions/upload-release-asset@v1 if: ${{ github.event_name == 'release' && github.event.action == 'created' }} env: @@ -109,8 +109,8 @@ jobs: WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: wheelhouse/$WHEEL_NAME - asset_name: $WHEEL_NAME + asset_path: "wheelhouse/$WHEEL_NAME" + asset_name: "$WHEEL_NAME" asset_content_type: application/zip manylinux-arm64: @@ -163,13 +163,13 @@ jobs: working-directory: wheelhouse run: | echo "WHEEL_NAME=$(ls *.whl)" - echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_OUTPUT + echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_OUTPUT" - uses: actions/upload-artifact@v3 env: WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: name: pypi-linux-${{ matrix.cpython_version }} - path: wheelhouse/$WHEEL_NAME + path: "wheelhouse/$WHEEL_NAME" - uses: actions/upload-release-asset@v1 if: ${{ github.event_name == 'release' && github.event.action == 'created' }} env: @@ -177,8 +177,8 @@ jobs: WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: wheelhouse/$WHEEL_NAME - asset_name: $WHEEL_NAME + asset_path: "wheelhouse/$WHEEL_NAME" + asset_name: "$WHEEL_NAME" asset_content_type: application/zip windows-x64: @@ -207,13 +207,13 @@ jobs: working-directory: pybuild/dist/ run: | echo "WHEEL_NAME=$(Get-ChildItem -name *.whl)" - echo "WHEEL_NAME=$(Get-ChildItem -name *.whl)" >> $GITHUB_OUTPUT + echo "WHEEL_NAME=$(Get-ChildItem -name *.whl)" >> "$GITHUB_OUTPUT" - uses: actions/upload-artifact@v3 env: WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: name: pypi-windows-py${{ matrix.python }} - path: pybuild/dist/$WHEEL_NAME + path: "pybuild/dist/$WHEEL_NAME" - uses: actions/upload-release-asset@v1 if: ${{ github.event_name == 'release' && github.event.action == 'created' }} env: @@ -221,8 +221,8 @@ jobs: WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: pybuild/dist/$WHEEL_NAME - asset_name: $WHEEL_NAME + asset_path: "pybuild/dist/$WHEEL_NAME" + asset_name: "$WHEEL_NAME" asset_content_type: application/zip publish: From 2cbb02b1fb698525e6c2b9d99204f1550a657d28 Mon Sep 17 00:00:00 2001 From: rturrado <68099809+rturrado@users.noreply.github.com> Date: Mon, 8 Jan 2024 15:37:28 +0100 Subject: [PATCH 5/8] Trying to retrieve WHEEL_NAME as a GITHUB_ENV variable. --- .github/workflows/assets.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/assets.yml b/.github/workflows/assets.yml index d7c6a4c0..2688edbf 100644 --- a/.github/workflows/assets.yml +++ b/.github/workflows/assets.yml @@ -40,9 +40,8 @@ jobs: run: | echo "WHEEL_NAME=$(ls *.whl)" echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_OUTPUT" + echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_ENV" - uses: actions/upload-artifact@v3 - env: - WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: name: pypi-macos-py${{ matrix.python }} path: "pybuild/dist/$WHEEL_NAME" @@ -50,7 +49,6 @@ jobs: if: ${{ github.event_name == 'release' && github.event.action == 'created' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: upload_url: ${{ github.event.release.upload_url }} asset_path: "pybuild/dist/$WHEEL_NAME" @@ -96,9 +94,8 @@ jobs: run: | echo "WHEEL_NAME=$(ls *.whl)" echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_OUTPUT" + echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_ENV" - uses: actions/upload-artifact@v3 - env: - WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: name: pypi-linux-${{ matrix.cpython_version }} path: "wheelhouse/$WHEEL_NAME" @@ -106,7 +103,6 @@ jobs: if: ${{ github.event_name == 'release' && github.event.action == 'created' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: upload_url: ${{ github.event.release.upload_url }} asset_path: "wheelhouse/$WHEEL_NAME" @@ -164,9 +160,8 @@ jobs: run: | echo "WHEEL_NAME=$(ls *.whl)" echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_OUTPUT" + echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_ENV" - uses: actions/upload-artifact@v3 - env: - WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: name: pypi-linux-${{ matrix.cpython_version }} path: "wheelhouse/$WHEEL_NAME" @@ -174,7 +169,6 @@ jobs: if: ${{ github.event_name == 'release' && github.event.action == 'created' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: upload_url: ${{ github.event.release.upload_url }} asset_path: "wheelhouse/$WHEEL_NAME" @@ -208,9 +202,8 @@ jobs: run: | echo "WHEEL_NAME=$(Get-ChildItem -name *.whl)" echo "WHEEL_NAME=$(Get-ChildItem -name *.whl)" >> "$GITHUB_OUTPUT" + echo "WHEEL_NAME=$(Get-ChildItem -name *.whl)" >> "$GITHUB_ENV" - uses: actions/upload-artifact@v3 - env: - WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: name: pypi-windows-py${{ matrix.python }} path: "pybuild/dist/$WHEEL_NAME" @@ -218,7 +211,6 @@ jobs: if: ${{ github.event_name == 'release' && github.event.action == 'created' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - WHEEL_NAME: ${{ steps.wheel.outputs.WHEEL_NAME }} with: upload_url: ${{ github.event.release.upload_url }} asset_path: "pybuild/dist/$WHEEL_NAME" From d86caf88d874b55728fc438a1ab8cfdccd937875 Mon Sep 17 00:00:00 2001 From: rturrado <68099809+rturrado@users.noreply.github.com> Date: Mon, 8 Jan 2024 15:58:53 +0100 Subject: [PATCH 6/8] Trying to retrieve WHEEL_NAME as a GITHUB_ENV variable. --- .github/workflows/assets.yml | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/assets.yml b/.github/workflows/assets.yml index 2688edbf..86d2b03e 100644 --- a/.github/workflows/assets.yml +++ b/.github/workflows/assets.yml @@ -38,21 +38,20 @@ jobs: id: wheel working-directory: pybuild/dist/ run: | - echo "WHEEL_NAME=$(ls *.whl)" echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_OUTPUT" echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_ENV" - uses: actions/upload-artifact@v3 with: name: pypi-macos-py${{ matrix.python }} - path: "pybuild/dist/$WHEEL_NAME" + path: pybuild/dist/${{ env.WHEEL_NAME }} - uses: actions/upload-release-asset@v1 if: ${{ github.event_name == 'release' && github.event.action == 'created' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: "pybuild/dist/$WHEEL_NAME" - asset_name: "$WHEEL_NAME" + asset_path: pybuild/dist/${{ env.WHEEL_NAME }} + asset_name: ${{ env.WHEEL_NAME }} asset_content_type: application/zip manylinux-x64: @@ -92,21 +91,20 @@ jobs: id: wheel working-directory: wheelhouse run: | - echo "WHEEL_NAME=$(ls *.whl)" echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_OUTPUT" echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_ENV" - uses: actions/upload-artifact@v3 with: name: pypi-linux-${{ matrix.cpython_version }} - path: "wheelhouse/$WHEEL_NAME" + path: wheelhouse/${{ env.WHEEL_NAME }} - uses: actions/upload-release-asset@v1 if: ${{ github.event_name == 'release' && github.event.action == 'created' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: "wheelhouse/$WHEEL_NAME" - asset_name: "$WHEEL_NAME" + asset_path: wheelhouse/${{ env.WHEEL_NAME }} + asset_name: ${{ env.WHEEL_NAME }} asset_content_type: application/zip manylinux-arm64: @@ -158,21 +156,20 @@ jobs: id: wheel working-directory: wheelhouse run: | - echo "WHEEL_NAME=$(ls *.whl)" echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_OUTPUT" echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_ENV" - uses: actions/upload-artifact@v3 with: name: pypi-linux-${{ matrix.cpython_version }} - path: "wheelhouse/$WHEEL_NAME" + path: wheelhouse/${{ env.WHEEL_NAME }} - uses: actions/upload-release-asset@v1 if: ${{ github.event_name == 'release' && github.event.action == 'created' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: "wheelhouse/$WHEEL_NAME" - asset_name: "$WHEEL_NAME" + asset_path: wheelhouse/${{ env.WHEEL_NAME }} + asset_name: ${{ env.WHEEL_NAME }} asset_content_type: application/zip windows-x64: @@ -200,21 +197,20 @@ jobs: id: wheel working-directory: pybuild/dist/ run: | - echo "WHEEL_NAME=$(Get-ChildItem -name *.whl)" echo "WHEEL_NAME=$(Get-ChildItem -name *.whl)" >> "$GITHUB_OUTPUT" echo "WHEEL_NAME=$(Get-ChildItem -name *.whl)" >> "$GITHUB_ENV" - uses: actions/upload-artifact@v3 with: name: pypi-windows-py${{ matrix.python }} - path: "pybuild/dist/$WHEEL_NAME" + path: pybuild/dist/${{ env.WHEEL_NAME }} - uses: actions/upload-release-asset@v1 if: ${{ github.event_name == 'release' && github.event.action == 'created' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: "pybuild/dist/$WHEEL_NAME" - asset_name: "$WHEEL_NAME" + asset_path: pybuild/dist/${{ env.WHEEL_NAME }} + asset_name: ${{ env.WHEEL_NAME }} asset_content_type: application/zip publish: From aa0afbcf2c4c042180b1df9c434b7fc4fe2db25f Mon Sep 17 00:00:00 2001 From: rturrado <68099809+rturrado@users.noreply.github.com> Date: Mon, 8 Jan 2024 16:41:43 +0100 Subject: [PATCH 7/8] Very minor changes to `RELEASE.md`. --- RELEASE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index cbecd56a..502a9f45 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,15 +1,15 @@ Release procedure ================= -Most of the release process is managed by GitHub Actions. If you follow the -procedure below, it will automatically test and build all wheels for all platforms, +Most of the release process is managed by GitHub Actions. If you follow the procedure below, +it will automatically test and build all wheels for all platforms, and publish them to PyPI assuming the secrets are configured correctly. - Make a branch with a name starting with "release" based upon the commit that is to be released. For example, `release-0.0.1`, but the suffix doesn't matter. - Change the version in `include/version.hpp` (this is the only place where the version is hardcoded) - and change any other files where applicable (`CHANGELOG.md`, etc), then commit and make a PR for it. + and change any other files where applicable (`CHANGELOG.md`, etc.), then commit and make a PR for it. - CI will now run not only the test workflow, but also the assets workflow. The assets workflow builds the wheels, but publishes them to the GitHub Actions build artifacts only. From cbaf179b58ab7f5866d1f026b8b97947f3da922c Mon Sep 17 00:00:00 2001 From: rturrado <68099809+rturrado@users.noreply.github.com> Date: Tue, 9 Jan 2024 16:01:00 +0100 Subject: [PATCH 8/8] Trying to fix upload-release-asset step in assets.yml for windows-x64 job. --- .github/workflows/assets.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/assets.yml b/.github/workflows/assets.yml index 86d2b03e..3d9d8d79 100644 --- a/.github/workflows/assets.yml +++ b/.github/workflows/assets.yml @@ -29,8 +29,8 @@ jobs: - name: Install dependencies run: | brew install bison flex - echo "/usr/local/opt/bison/bin" >> "$GITHUB_PATH" - echo "/usr/local/opt/flex/bin" >> "$GITHUB_PATH" + echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH + echo "/usr/local/opt/flex/bin" >> $GITHUB_PATH python -m pip install --upgrade pip conan setuptools wheel - name: Build wheel run: python setup.py bdist_wheel @@ -38,8 +38,8 @@ jobs: id: wheel working-directory: pybuild/dist/ run: | - echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_OUTPUT" - echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_ENV" + echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_OUTPUT + echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_ENV - uses: actions/upload-artifact@v3 with: name: pypi-macos-py${{ matrix.python }} @@ -91,8 +91,8 @@ jobs: id: wheel working-directory: wheelhouse run: | - echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_OUTPUT" - echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_ENV" + echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_OUTPUT + echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_ENV - uses: actions/upload-artifact@v3 with: name: pypi-linux-${{ matrix.cpython_version }} @@ -156,8 +156,8 @@ jobs: id: wheel working-directory: wheelhouse run: | - echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_OUTPUT" - echo "WHEEL_NAME=$(ls *.whl)" >> "$GITHUB_ENV" + echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_OUTPUT + echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_ENV - uses: actions/upload-artifact@v3 with: name: pypi-linux-${{ matrix.cpython_version }} @@ -197,8 +197,9 @@ jobs: id: wheel working-directory: pybuild/dist/ run: | - echo "WHEEL_NAME=$(Get-ChildItem -name *.whl)" >> "$GITHUB_OUTPUT" - echo "WHEEL_NAME=$(Get-ChildItem -name *.whl)" >> "$GITHUB_ENV" + echo "WHEEL_NAME=$(Get-ChildItem -name *.whl)" >> $env:GITHUB_OUTPUT + echo "WHEEL_NAME=$(Get-ChildItem -name *.whl)" >> $env:GITHUB_ENV + shell: powershell - uses: actions/upload-artifact@v3 with: name: pypi-windows-py${{ matrix.python }}