Skip to content

Commit

Permalink
Separate build and upload jobs (#6)
Browse files Browse the repository at this point in the history
* Split into build and release => multi-image build

* Run pre-release for PRs
  • Loading branch information
smheidrich authored Sep 21, 2022
1 parent 28a07ad commit 09109c2
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 15 deletions.
33 changes: 24 additions & 9 deletions .github/workflows/build-and-prelease.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
name: Build and pre-release on GitHub

on:
push:
branches: [ main ]
on: push

jobs:
build_and_release_wheels_x86_64:
build_wheels_x86_64:
runs-on: ubuntu-latest
container:
image: quay.io/pypa/manylinux_2_24_x86_64
strategy:
fail-fast: false
matrix:
image-name:
- manylinux2014_x86_64
- manylinux_2_24_x86_64
container:
image: quay.io/pypa/${{ matrix.image-name }}
steps:
- name: Check out repo and submodule repos
uses: actions/checkout@v2
Expand All @@ -32,7 +34,7 @@ jobs:
- name: Skim Rust build cache
uses: actions/cache@v2
env:
cache-name: cache-skim-build
cache-name: cache-skim-build-${{ matrix.image-name }}
with:
path: skim-fork/target
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('skim-fork/**/*') }}
Expand Down Expand Up @@ -66,14 +68,27 @@ jobs:
mv dist dist_unaudited
mkdir dist
for whl in dist_unaudited/*.whl; do
auditwheel repair "$whl" -w dist/
auditwheel repair "$whl" --plat "${{ matrix.image-name }}" -w dist/
done
- name: Upload wheels as artifacts
uses: actions/upload-artifact@v2
with:
name: wheels
name: wheels-${{ matrix.image-name }}
path: |
dist
pre_release_wheels_x86_64:
needs: build_wheels_x86_64
runs-on: ubuntu-latest
container:
image: quay.io/pypa/manylinux_2_24_x86_64
steps:
- name: Download all wheel artifacts
uses: actions/download-artifact@v3
with:
path: dist
- name: Move wheel artifacts
run: |
cd dist && mv */*.whl ./
- name: Publish as GitHub pre-release
uses: "marvinpinto/action-automatic-releases@latest"
with:
Expand Down
29 changes: 23 additions & 6 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ on:
- "[0-9].*"

jobs:
build_and_release_wheels_x86_64:
build_wheels_x86_64:
runs-on: ubuntu-latest
container:
image: quay.io/pypa/manylinux_2_24_x86_64
strategy:
fail-fast: false
matrix:
image-name:
- manylinux2014_x86_64
- manylinux_2_24_x86_64
container:
image: quay.io/pypa/${{ matrix.image-name }}
steps:
- name: Check out repo and submodule repos
uses: actions/checkout@v2
Expand All @@ -33,7 +37,7 @@ jobs:
- name: Skim Rust build cache
uses: actions/cache@v2
env:
cache-name: cache-skim-build
cache-name: cache-skim-build-${{ matrix.image-name }}
with:
path: skim-fork/target
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('skim-fork/**/*') }}
Expand Down Expand Up @@ -67,14 +71,27 @@ jobs:
mv dist dist_unaudited
mkdir dist
for whl in dist_unaudited/*.whl; do
auditwheel repair "$whl" -w dist/
auditwheel repair "$whl" --plat "${{ matrix.image-name }}" -w dist/
done
- name: Upload wheels as artifacts
uses: actions/upload-artifact@v2
with:
name: wheels
name: wheels-${{ matrix.image-name }}
path: |
dist
release_wheels_x86_64:
needs: build_wheels_x86_64
runs-on: ubuntu-latest
container:
image: quay.io/pypa/manylinux_2_24_x86_64
steps:
- name: Download all wheel artifacts
uses: actions/download-artifact@v3
with:
path: dist
- name: Move wheel artifacts
run: |
cd dist && mv */*.whl ./
- name: Publish as GitHub release
uses: "marvinpinto/action-automatic-releases@latest"
with:
Expand Down

0 comments on commit 09109c2

Please sign in to comment.