From fd8670854617f70715181c45579a0335384bfeef Mon Sep 17 00:00:00 2001 From: Andre Masella Date: Wed, 26 Apr 2023 14:40:15 -0400 Subject: [PATCH 1/2] Create a GitHub Action to build wheels As titled. --- .github/workflows/release.yml | 83 +++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 2 +- 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..125cdb99 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,83 @@ +name: Release + +permissions: + contents: write + +on: + push: + tags: + - v[0-9]+.* + +jobs: + # First we are going to create a task that generates a new release in GitHub + # as a draft. All the wheels will end up being uploaded here at the end. + create-release: + runs-on: ubuntu-latest + outputs: + tag: ${{ steps.create-gh-release.outputs.computed-prefix }}${{ steps.create-gh-release.outputs.version }} + steps: + - uses: actions/checkout@v3 + - id: create-gh-release + uses: taiki-e/create-gh-release-action@v1 + with: + draft: true + token: ${{ secrets.GITHUB_TOKEN }} + + build-wheels: + # Build binary wheels for the platforms we care about using cibuildwheel. + name: Build wheels + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-python@v3 + with: + python-version: '3.11' + + - name: Build wheels + run: "pip wheel -w wheelhouse ." + + - uses: actions/upload-artifact@v3 + with: + path: ./wheelhouse/numba_rvsdg-*.whl + + build-sdist: + # Build a source package. This is actually easy. + name: Make SDist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Build SDist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v3 + with: + path: dist/*.tar.gz + + upload-all: + needs: [build-wheels, build-sdist, create-release] + runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + with: + name: artifact + path: dist + - name: run cargo-dist manifest + run: | + gh release upload ${{ needs.create-release.outputs.tag }} dist/* + + # Mark the Github Release™️ as a non-draft now that everything has succeeded! + publish-release: + needs: [create-release, upload-all] + runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v3 + - name: mark release as non-draft + run: | + gh release edit ${{ needs.create-release.outputs.tag }} --draft=false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9c235002..7de30982 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Miniconda From 90bc2d5ca3e7125eecbd1ebd79d37cef2e969b17 Mon Sep 17 00:00:00 2001 From: esc Date: Wed, 19 Jul 2023 15:35:38 +0200 Subject: [PATCH 2/2] be more stringent with the accepted regex As title --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 125cdb99..09cdd9a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ permissions: on: push: tags: - - v[0-9]+.* + - v[0-9]+.[0-9]+.[0-9]+ jobs: # First we are going to create a task that generates a new release in GitHub