From 453c84cdb9b3088900417efc54bb6b7a4cc15491 Mon Sep 17 00:00:00 2001 From: Bo Bayles Date: Mon, 5 Jun 2023 14:42:58 -0500 Subject: [PATCH 1/5] Update build.yml for PyPI releases --- .github/workflows/build.yml | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aadbc72..099182d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,20 +21,37 @@ jobs: build_wheels: strategy: matrix: - os: ["ubuntu-20.04", "macos-11"] + os: ["ubuntu-latest", "macos-11"] runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - run: make requirements c_lib + - uses: pypa/cibuildwheel@v2.13.0 + - uses: actions/upload-artifact@v3 + with: + name: ada-url-packages + path: wheelhouse/*.whl + make_sdist: + runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v3 - - name: Install dependencies - run: | - make requirements c_lib - - name: Build wheels - uses: pypa/cibuildwheel@v2.12.3 - - name: Upload packages - if: github.event_name == 'push' - uses: actions/upload-artifact@v3 + - run: python -m build --no-isolation --sdist + - uses: actions/upload-artifact@v3 + with: + path: dist/*.tar.gz + + upload_all: + needs: [build_wheels, make_sdist] + runs-on: "ubuntu-latest" + environment: release + if: github.event_name == 'release' && github.event.action == 'published' + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v3 with: name: ada-url-packages - path: wheelhouse/* + path: wheelhouse + - uses: pypa/gh-action-pypi-publish@release/v1 From 40d6eaa5c57cae656c9b36ecdf95895d4e5a5cc2 Mon Sep 17 00:00:00 2001 From: Bo Bayles Date: Mon, 5 Jun 2023 14:45:26 -0500 Subject: [PATCH 2/5] Use default artifact name --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 099182d..fd12f95 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,6 @@ jobs: - uses: pypa/cibuildwheel@v2.13.0 - uses: actions/upload-artifact@v3 with: - name: ada-url-packages path: wheelhouse/*.whl make_sdist: From 6796aa8d7d193220e6e11638cc2ea2e6986c1be9 Mon Sep 17 00:00:00 2001 From: Bo Bayles Date: Mon, 5 Jun 2023 14:47:03 -0500 Subject: [PATCH 3/5] Build on published release --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd12f95..da75584 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,10 @@ on: - '**.rst' - 'docs/**' + release: + types: + - published + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true From d4baa28a197e8da27b3fbeb47dca88009c45d95f Mon Sep 17 00:00:00 2001 From: Bo Bayles Date: Mon, 5 Jun 2023 14:49:53 -0500 Subject: [PATCH 4/5] Make requirements for sdist --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da75584..04907ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,9 @@ jobs: runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v3 - - run: python -m build --no-isolation --sdist + - run: | + make requirements + python -m build --no-isolation --sdist - uses: actions/upload-artifact@v3 with: path: dist/*.tar.gz From b4413029c5b857b8ad6b2258e08d20ea31001d9f Mon Sep 17 00:00:00 2001 From: Bo Bayles Date: Mon, 5 Jun 2023 14:54:44 -0500 Subject: [PATCH 5/5] Use latest macOS --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 04907ea..a5968b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: build_wheels: strategy: matrix: - os: ["ubuntu-latest", "macos-11"] + os: ["ubuntu-latest", "macos-latest"] runs-on: ${{ matrix.os }} steps: