Skip to content

Commit

Permalink
Update for openslide-winbuild workflow changes
Browse files Browse the repository at this point in the history
For openslide/openslide-bin#169.  Track both Linux and Windows
builder containers.

Signed-off-by: Benjamin Gilbert <[email protected]>
  • Loading branch information
bgilbert committed Oct 30, 2023
1 parent df5df87 commit 9506122
Show file tree
Hide file tree
Showing 4 changed files with 353 additions and 239 deletions.
41 changes: 26 additions & 15 deletions .github/workflows/winbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ jobs:
name: Set up
runs-on: ubuntu-latest
outputs:
builder_repo_and_digest: ${{ steps.find.outputs.builder_repo_and_digest }}
linux_builder_repo_and_digest: ${{ steps.find-linux.outputs.builder_repo_and_digest }}
windows_builder_repo_and_digest: ${{ steps.find-windows.outputs.builder_repo_and_digest }}
pkgver: ${{ steps.params.outputs.pkgver }}
openslide_commit: ${{ steps.params.outputs.openslide_commit }}
java_commit: ${{ steps.params.outputs.java_commit }}
Expand All @@ -33,8 +34,13 @@ jobs:
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Find builder container digest
id: find
- name: Find Linux builder container digest
id: find-linux
uses: openslide/openslide-winbuild/.github/find-container-digest@main
with:
builder_image: linux
- name: Find Windows builder container digest
id: find-windows
uses: openslide/openslide-winbuild/.github/find-container-digest@main
with:
builder_image: windows
Expand Down Expand Up @@ -72,23 +78,27 @@ jobs:
echo " -> unchanged"
fi
done
old=$(jq -r '.builds[-1]["builder"]' docs/index.json)
new="${{ steps.find.outputs.builder_repo_and_digest }}"
echo "Builder container: $new"
if [ "$old" != "$new" ]; then
echo " -> changed from $old"
echo "changed=true" >> $GITHUB_OUTPUT
else
echo " -> unchanged"
fi
for repo in "linux|${{ steps.find.outputs.linux_builder_repo_and_digest }}" "windows|${{ steps.find.outputs.windows_builder_repo_and_digest }}"; do
name="${repo%%|*}"
old=$(jq -r ".builds[-1][\"${name}-builder\"]" docs/index.json)
new="${repo##*|}"
echo "$name builder container: $new"
if [ "$old" != "$new" ]; then
echo " -> changed from $old"
echo "changed=true" >> $GITHUB_OUTPUT
else
echo " -> unchanged"
fi
done
build:
name: Build
needs: setup
if: needs.setup.outputs.changed
uses: openslide/openslide-winbuild/.github/workflows/windows.yml@main
uses: openslide/openslide-winbuild/.github/workflows/build.yml@main
with:
builder_repo_and_digest: ${{ needs.setup.outputs.builder_repo_and_digest }}
linux_builder_repo_and_digest: ${{ needs.setup.outputs.linux_builder_repo_and_digest }}
windows_builder_repo_and_digest: ${{ needs.setup.outputs.windows_builder_repo_and_digest }}
openslide_repo: openslide/openslide
openslide_ref: ${{ needs.setup.outputs.openslide_commit }}
openslide_java_repo: openslide/openslide-java
Expand Down Expand Up @@ -117,7 +127,8 @@ jobs:
run: |
scripts/make-index.py \
--pkgver "${{ needs.setup.outputs.pkgver }}" \
--builder "${{ needs.setup.outputs.builder_repo_and_digest }}" \
--linux-builder "${{ needs.setup.outputs.linux_builder_repo_and_digest }}" \
--windows-builder "${{ needs.setup.outputs.windows_builder_repo_and_digest }}" \
--openslide "${{ needs.setup.outputs.openslide_commit }}" \
--java "${{ needs.setup.outputs.java_commit }}" \
--winbuild "${{ needs.setup.outputs.winbuild_commit }}"
Expand Down
Loading

0 comments on commit 9506122

Please sign in to comment.