Skip to content

Commit

Permalink
fixup! fixup! fixup! .github/workflows/gen-images.yml: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
classabbyamp committed Feb 16, 2024
1 parent 130ab3b commit 6fd6ca1
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/gen-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ on:
description: "Override datecode for images"
required: false
type: string
mirror:
description: "Mirror to use"
default: "https://repo-ci.voidlinux.org/current"
required: false
type: string
live_iso_flag:
description: "Build live ISOs"
default: true
Expand Down Expand Up @@ -73,6 +68,7 @@ jobs:
outputs:
datecode: ${{ steps.prep.outputs.datecode }}
revision: ${{ steps.prep.outputs.revision }}
mirror: ${{ steps.prep.outputs.mirror }}

steps:
- name: Prepare Environment
Expand All @@ -84,6 +80,7 @@ jobs:
echo "datecode=${{ inputs.datecode }}" >> $GITHUB_OUTPUT
fi
echo "revision=${GITHUB_SHA:0:8}" >> $GITHUB_OUTPUT
echo "mirror=https://repo-ci.voidlinux.org/current" >> $GITHUB_OUTPUT
build-live-isos:
name: Build Live ISOs
Expand All @@ -106,7 +103,8 @@ 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|'"${{ inputs.mirror }}"'|g' /etc/xbps.d/*-repository-*.conf
sed -i 's|https://repo-default.voidlinux.org/current|'"${{ needs.prepare.outputs.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)
Expand All @@ -119,7 +117,7 @@ jobs:
- name: Build live ISOs
run: |
make live-iso-all-print live-iso-all \
SUDO= REPOSITORY="${{ inputs.mirror }}" \
SUDO= REPOSITORY="${{ needs.prepare.outputs.mirror }}" \
DATECODE="${{ needs.prepare.outputs.datecode }}" \
LIVE_ARCHS="${{ inputs.live_archs }}" LIVE_FLAVORS="${{ inputs.live_flavors }}"
Expand Down Expand Up @@ -155,7 +153,8 @@ 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|'"${{ inputs.mirror }}"'|g' /etc/xbps.d/*-repository-*.conf
sed -i 's|https://repo-default.voidlinux.org/current|'"${{ needs.prepare.outputs.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)
Expand All @@ -168,7 +167,7 @@ jobs:
- name: Build ROOTFSes
run: |
make rootfs-all-print rootfs-all \
SUDO= REPOSITORY="${{ inputs.mirror }}" \
SUDO= REPOSITORY="${{ needs.prepare.outputs.mirror }}" \
DATECODE="${{ needs.prepare.outputs.datecode }}" \
ARCHS="${{ inputs.rootfs }}"
Expand Down Expand Up @@ -204,7 +203,8 @@ 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|'"${{ inputs.mirror }}"'|g' /etc/xbps.d/*-repository-*.conf
sed -i 's|https://repo-default.voidlinux.org/current|'"${{ needs.prepare.outputs.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)
Expand All @@ -217,7 +217,7 @@ jobs:
- name: Build PLATFORMFSes
run: |
make platformfs-all-print platformfs-all \
SUDO= REPOSITORY="${{ inputs.mirror }}" \
SUDO= REPOSITORY="${{ needs.prepare.outputs.mirror }}" \
DATECODE="${{ needs.prepare.outputs.datecode }}" \
PLATFORMS="${{ inputs.platformfs }}"
Expand Down Expand Up @@ -254,7 +254,8 @@ 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|'"${{ inputs.mirror }}"'|g' /etc/xbps.d/*-repository-*.conf
sed -i 's|https://repo-default.voidlinux.org/current|'"${{ needs.prepare.outputs.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)
Expand All @@ -267,7 +268,7 @@ jobs:
- name: Build SBC Images
run: |
make images-all-sbc-print images-all-sbc \
SUDO= REPOSITORY="${{ inputs.mirror }}" \
SUDO= REPOSITORY="${{ needs.prepare.outputs.mirror }}" \
DATECODE="${{ needs.prepare.outputs.datecode }}" \
SBC_IMGS="${{ inputs.sbc_imgs }}"
Expand Down Expand Up @@ -306,7 +307,8 @@ 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|'"${{ inputs.mirror }}"'|g' /etc/xbps.d/*-repository-*.conf
sed -i 's|https://repo-default.voidlinux.org/current|'"${{ needs.prepare.outputs.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)
Expand Down

0 comments on commit 6fd6ca1

Please sign in to comment.