diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..09cdd9a0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,83 @@ +name: Release + +permissions: + contents: write + +on: + push: + tags: + - v[0-9]+.[0-9]+.[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