Attempts to fix output variable collisions.
GitHub actions outputs don't jive well with matrices for `runs-on`. They overwrite without warning. Switch to running update checks in a singleton job, and then add which distros need updating.main
parent
374b27c0cd
commit
fbe6d1f79c
|
@ -15,16 +15,9 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
check-upstream:
|
check-upstream:
|
||||||
name: Check for a new releases upstream
|
name: Check for a new releases upstream
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
- ubuntu-22.04
|
|
||||||
- ubuntu-20.04
|
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
ubuntu_release: ${{ steps.set-ubuntu-release-name.outputs.ubuntu_release }}
|
|
||||||
innernet_release: ${{ steps.check-latest-release.outputs.innernet_release }}
|
innernet_release: ${{ steps.check-latest-release.outputs.innernet_release }}
|
||||||
innernet_version: ${{ steps.check-latest-release.outputs.innernet_version }}
|
innernet_version: ${{ steps.check-latest-release.outputs.innernet_version }}
|
||||||
tarball_url: ${{ steps.check-latest-release.outputs.tarball_url }}
|
tarball_url: ${{ steps.check-latest-release.outputs.tarball_url }}
|
||||||
|
@ -64,21 +57,24 @@ jobs:
|
||||||
- name: Check Repo Release
|
- name: Check Repo Release
|
||||||
id: check-repo-release
|
id: check-repo-release
|
||||||
run: |
|
run: |
|
||||||
# Note the leading v to match the Git tag.
|
new_release_exists=
|
||||||
indexed=v$(reprepro -b debian --list-format '${version}\n' listmatched "${{ steps.set-ubuntu-release-name.outputs.ubuntu_release }}" innernet)
|
for ver_codename in ubuntu-22.04/jammy ubuntu-20.04/focal; do
|
||||||
upstream="${{ steps.check-latest-release.outputs.innernet_release }}-0ubuntu0~${{ steps.set-ubuntu-release-name.outputs.ubuntu_release }}"
|
ver=${ver_codename%/*}
|
||||||
echo "Repo release: $indexed"
|
codename=${ver_codename##*/}
|
||||||
if [ "x$indexed" = "x$upstream" ]; then
|
# Note the leading v to match the Git tag.
|
||||||
echo "new_release_exists=false" >>"$GITHUB_OUTPUT"
|
indexed=v$(reprepro -b debian --list-format '${version}\n' listmatched "$codename" innernet)
|
||||||
else
|
upstream="${{ steps.check-latest-release.outputs.innernet_release }}-0ubuntu0~$codename"
|
||||||
echo "new_release_exists=true" >>"$GITHUB_OUTPUT"
|
echo "Repo release in $codename: $indexed"
|
||||||
fi
|
if [ "x$indexed" != "x$upstream" ]; then
|
||||||
|
new_release_exists="${new_release_exists:+$new_release_exists }$ver"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "new_release_exists=$new_release_exists" >>"$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Show Output
|
- name: Show Output
|
||||||
id: show-output
|
id: show-output
|
||||||
run: |
|
run: |
|
||||||
echo "## Job Outputs" >>"$GITHUB_STEP_SUMMARY"
|
echo "## Job Outputs" >>"$GITHUB_STEP_SUMMARY"
|
||||||
echo "* \`ubuntu_release=${{ steps.set-ubuntu-release-name.outputs.ubuntu_release }}\`" >>"$GITHUB_STEP_SUMMARY"
|
|
||||||
echo "* \`innernet_release=${{ steps.check-latest-release.outputs.innernet_release }}\`" >>"$GITHUB_STEP_SUMMARY"
|
echo "* \`innernet_release=${{ steps.check-latest-release.outputs.innernet_release }}\`" >>"$GITHUB_STEP_SUMMARY"
|
||||||
echo "* \`innernet_version=${{ steps.check-latest-release.outputs.innernet_version }}\`" >>"$GITHUB_STEP_SUMMARY"
|
echo "* \`innernet_version=${{ steps.check-latest-release.outputs.innernet_version }}\`" >>"$GITHUB_STEP_SUMMARY"
|
||||||
echo "* \`new_release_exists=${{ steps.check-repo-release.outputs.new_release_exists }}\`" >>"$GITHUB_STEP_SUMMARY"
|
echo "* \`new_release_exists=${{ steps.check-repo-release.outputs.new_release_exists }}\`" >>"$GITHUB_STEP_SUMMARY"
|
||||||
|
@ -86,7 +82,7 @@ jobs:
|
||||||
build-deb:
|
build-deb:
|
||||||
name: Build DEB Packages
|
name: Build DEB Packages
|
||||||
needs: [check-upstream]
|
needs: [check-upstream]
|
||||||
if: ${{ needs.check-upstream.outputs.new_release_exists == 'true' }}
|
if: ${{ contains(needs.check-upstream.outputs.new_release_exists, matrix.os) }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -142,7 +138,7 @@ jobs:
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: [check-upstream, build-deb]
|
needs: [check-upstream, build-deb]
|
||||||
if: ${{ needs.check-upstream.outputs.new_release_exists == 'true' }}
|
if: ${{ contains(needs.check-upstream.outputs.new_release_exists, matrix.os) }}
|
||||||
# Avoid push conflicts.
|
# Avoid push conflicts.
|
||||||
concurrency: update_repository
|
concurrency: update_repository
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
Loading…
Reference in New Issue