From 1646847b5c55ff754710d76856fe798590d57c47 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 16 Feb 2024 01:44:42 -0500 Subject: [PATCH] fixup! fixup! fixup! .github/workflows/gen-images.yml: refactor --- .github/workflows/gen-images.yml | 73 +++++++++++++++++--------------- 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/.github/workflows/gen-images.yml b/.github/workflows/gen-images.yml index 4ebb336284..9ce9d959ae 100644 --- a/.github/workflows/gen-images.yml +++ b/.github/workflows/gen-images.yml @@ -46,12 +46,13 @@ jobs: prepare: name: Prepare Environment runs-on: ubuntu-latest - defaults: - run: - shell: bash outputs: datecode: ${{ steps.prep.outputs.datecode }} revision: ${{ steps.prep.outputs.revision }} + + defaults: + run: + shell: bash steps: - name: Prepare Environment id: prep @@ -69,6 +70,9 @@ jobs: needs: prepare if: ${{ inputs.live_archs != '' && inputs.live_flavors != '' }} + defaults: + run: + shell: bash container: image: 'ghcr.io/void-linux/void-glibc-full:20231230R1' options: --privileged @@ -76,9 +80,7 @@ jobs: - /dev:/dev env: PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin' - DATECODE: "${{ needs.prepare.outputs.datecode }}" MKLIVE_REV: "${{ needs.prepare.outputs.revision }}" - REPO: "${{ inputs.mirror }}" steps: - name: Prepare container @@ -86,7 +88,7 @@ jobs: run: | # Switch to mirror mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/ - sed -i 's|https://repo-default.voidlinux.org/current|'"$REPO"'|g' /etc/xbps.d/*-repository-*.conf + sed -i 's|https://repo-default.voidlinux.org/current|'"${{ inputs.mirror }}"'|g' /etc/xbps.d/*-repository-*.conf # Sync and upgrade once, assume error comes from xbps update xbps-install -Syu || xbps-install -yu xbps # Upgrade again (in case there was a xbps update) @@ -99,18 +101,18 @@ jobs: - name: Build live ISOs run: | make live-iso-all-print live-iso-all \ - SUDO= REPOSITORY="$REPO" DATECODE=$DATECODE \ + SUDO= REPOSITORY="${{ inputs.mirror }}" DATECODE="${{ needs.prepare.outputs.datecode }}" \ LIVE_ARCHS="${{ inputs.live_archs }}" LIVE_FLAVORS="${{ inputs.live_flavors }}" - name: Prepare artifacts for upload run: | - make dist checksum DATECODE=$DATECODE + make dist checksum DATECODE="${{ needs.prepare.outputs.datecode }}" - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: void-live-${{ env.DATECODE }} + name: void-live-${{ needs.prepare.outputs.datecode }} path: | - distdir-${{ env.DATECODE }}/* + distdir-*/* if-no-files-found: error build-rootfs: @@ -119,6 +121,9 @@ jobs: needs: prepare if: ${{ inputs.rootfs != '' }} + defaults: + run: + shell: bash container: image: 'ghcr.io/void-linux/void-glibc-full:20231230R1' options: --privileged @@ -126,9 +131,7 @@ jobs: - /dev:/dev env: PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin' - DATECODE: "${{ needs.prepare.outputs.datecode }}" MKLIVE_REV: "${{ needs.prepare.outputs.revision }}" - REPO: "${{ inputs.mirror }}" steps: - name: Prepare container @@ -136,7 +139,7 @@ jobs: run: | # Switch to mirror mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/ - sed -i 's|https://repo-default.voidlinux.org/current|'"$REPO"'|g' /etc/xbps.d/*-repository-*.conf + sed -i 's|https://repo-default.voidlinux.org/current|'"${{ inputs.mirror }}"'|g' /etc/xbps.d/*-repository-*.conf # Sync and upgrade once, assume error comes from xbps update xbps-install -Syu || xbps-install -yu xbps # Upgrade again (in case there was a xbps update) @@ -149,18 +152,18 @@ jobs: - name: Build ROOTFSes run: | make rootfs-all-print rootfs-all \ - SUDO= REPOSITORY="$REPO" DATECODE=$DATECODE \ + SUDO= REPOSITORY="${{ inputs.mirror }}" DATECODE="${{ needs.prepare.outputs.datecode }}" \ ARCHS="${{ inputs.rootfs }}" - name: Prepare artifacts for upload run: | - make dist checksum DATECODE="$DATECODE" + make dist checksum DATECODE="${{ needs.prepare.outputs.datecode }}" - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: void-rootfs-${{ env.DATECODE }} + name: void-rootfs-${{ needs.prepare.outputs.datecode }} path: | - distdir-${{ env.DATECODE }}/* + distdir-*/* if-no-files-found: error build-platformfs: @@ -169,6 +172,9 @@ jobs: needs: prepare if: ${{ inputs.platformfs != '' }} + defaults: + run: + shell: bash container: image: 'ghcr.io/void-linux/void-glibc-full:20231230R1' options: --privileged @@ -176,9 +182,7 @@ jobs: - /dev:/dev env: PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin' - DATECODE: "${{ needs.prepare.outputs.datecode }}" MKLIVE_REV: "${{ needs.prepare.outputs.revision }}" - REPO: "${{ inputs.mirror }}" steps: - name: Prepare container @@ -186,7 +190,7 @@ jobs: run: | # Switch to mirror mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/ - sed -i 's|https://repo-default.voidlinux.org/current|'"$REPO"'|g' /etc/xbps.d/*-repository-*.conf + sed -i 's|https://repo-default.voidlinux.org/current|'"${{ inputs.mirror }}"'|g' /etc/xbps.d/*-repository-*.conf # Sync and upgrade once, assume error comes from xbps update xbps-install -Syu || xbps-install -yu xbps # Upgrade again (in case there was a xbps update) @@ -199,19 +203,19 @@ jobs: - name: Build PLATFORMFSes run: | make platformfs-all-print platformfs-all \ - SUDO= REPOSITORY="$REPO" DATECODE=$DATECODE \ + SUDO= REPOSITORY="${{ inputs.mirror }}" DATECODE="${{ needs.prepare.outputs.datecode }}" \ PLATFORMS="${{ inputs.platformfs }}" - name: Prepare artifacts for upload run: | - make dist checksum DATECODE="$DATECODE" + make dist checksum DATECODE="${{ needs.prepare.outputs.datecode }}" - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: void-platformfs-${{ env.DATECODE }} + name: void-platformfs-${{ needs.prepare.outputs.datecode }} path: | - distdir-${{ env.DATECODE }}/* - !distdir-${{ env.DATECODE }}/*ROOTFS* + distdir-*/* + !distdir-*/*ROOTFS* if-no-files-found: error build-sbc-img: @@ -220,6 +224,9 @@ jobs: needs: prepare if: ${{ inputs.sbc_imgs != '' }} + defaults: + run: + shell: bash container: image: 'ghcr.io/void-linux/void-glibc-full:20231230R1' options: --privileged @@ -227,9 +234,7 @@ jobs: - /dev:/dev env: PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin' - DATECODE: "${{ needs.prepare.outputs.datecode }}" MKLIVE_REV: "${{ needs.prepare.outputs.revision }}" - REPO: "${{ inputs.mirror }}" steps: - name: Prepare container @@ -237,7 +242,7 @@ jobs: run: | # Switch to mirror mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/ - sed -i 's|https://repo-default.voidlinux.org/current|'"$REPO"'|g' /etc/xbps.d/*-repository-*.conf + sed -i 's|https://repo-default.voidlinux.org/current|'"${{ inputs.mirror }}"'|g' /etc/xbps.d/*-repository-*.conf # Sync and upgrade once, assume error comes from xbps update xbps-install -Syu || xbps-install -yu xbps # Upgrade again (in case there was a xbps update) @@ -250,18 +255,18 @@ jobs: - name: Build SBC Images run: | make images-all-sbc-print images-all-sbc \ - SUDO= REPOSITORY="$REPO" DATECODE=$DATECODE \ + SUDO= REPOSITORY="${{ inputs.mirror }}" DATECODE="${{ needs.prepare.outputs.datecode }}" \ SBC_IMGS="${{ inputs.sbc_imgs }}" - name: Prepare artifacts for upload run: | - make dist checksum DATECODE="$DATECODE" + make dist checksum DATECODE="${{ needs.prepare.outputs.datecode }}" - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: void-sbc-img-${{ env.DATECODE }} + name: void-sbc-img-${{ needs.prepare.outputs.datecode }} path: | - distdir-${{ env.DATECODE }}/* - !distdir-${{ env.DATECODE }}/*ROOTFS* - !distdir-${{ env.DATECODE }}/*PLATFORMFS* + distdir-*/* + !distdir-*/*ROOTFS* + !distdir-*/*PLATFORMFS* if-no-files-found: error