|
| 1 | +name: Build void images |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + datecode: |
| 7 | + description: "Override datecode for images" |
| 8 | + required: false |
| 9 | + type: string |
| 10 | + mirror: |
| 11 | + description: "Mirror to use" |
| 12 | + default: "https://repo-ci.voidlinux.org/current" |
| 13 | + required: false |
| 14 | + type: string |
| 15 | + live_archs: |
| 16 | + description: "Archs to build live ISOs for" |
| 17 | + default: "x86_64 x86_64-musl i686" |
| 18 | + required: false |
| 19 | + type: string |
| 20 | + live_flavors: |
| 21 | + description: "Flavors to build live ISOs for" |
| 22 | + default: "base xfce" |
| 23 | + required: false |
| 24 | + type: string |
| 25 | + rootfs: |
| 26 | + description: "Archs to build ROOTFSes for" |
| 27 | + default: "x86_64 x86_64-musl i686 armv6l armv6l-musl armv7l armv7l-musl aarch64 aarch64-musl" |
| 28 | + required: false |
| 29 | + type: string |
| 30 | + platformfs: |
| 31 | + description: "Platforms to build PLATFORMFSes for" |
| 32 | + default: "rpi-armv6l rpi-armv6l-musl rpi-armv7l rpi-armv7l-musl rpi-aarch64 rpi-aarch64-musl" |
| 33 | + required: false |
| 34 | + type: string |
| 35 | + sbc_imgs: |
| 36 | + description: "Platforms to build SBC images for" |
| 37 | + default: "rpi-armv6l rpi-armv6l-musl rpi-armv7l rpi-armv7l-musl rpi-aarch64 rpi-aarch64-musl" |
| 38 | + required: false |
| 39 | + type: string |
| 40 | + |
| 41 | +concurrency: |
| 42 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 43 | + cancel-in-progress: true |
| 44 | + |
| 45 | +jobs: |
| 46 | + build: |
| 47 | + name: Build |
| 48 | + runs-on: ubuntu-latest |
| 49 | + |
| 50 | + defaults: |
| 51 | + run: |
| 52 | + shell: bash |
| 53 | + |
| 54 | + container: |
| 55 | + image: 'ghcr.io/void-linux/void-linux:20230204RC01-full-x86_64' |
| 56 | + options: --privileged |
| 57 | + volumes: |
| 58 | + - /dev:/dev |
| 59 | + env: |
| 60 | + PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin' |
| 61 | + DATECODE: "${{ inputs.datecode }}" |
| 62 | + LIVE_ARCHS: "${{ inputs.live_archs }}" |
| 63 | + LIVE_FLAVORS: "${{ inputs.live_flavors }}" |
| 64 | + ROOTFS_ARCHS: "${{ inputs.rootfs }}" |
| 65 | + PLATFORMS: "${{ inputs.platformfs }}" |
| 66 | + SBC_IMGS: "${{ inputs.sbc_imgs }}" |
| 67 | + REPO: "${{ inputs.mirror }}" |
| 68 | + |
| 69 | + steps: |
| 70 | + - name: Prepare container |
| 71 | + shell: sh |
| 72 | + run: | |
| 73 | + # Switch to repo-ci mirror |
| 74 | + mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/ |
| 75 | + sed -i 's|https://repo-default.voidlinux.org/current|'"$REPO"'|g' /etc/xbps.d/*-repository-*.conf |
| 76 | + # Sync and upgrade once, assume error comes from xbps update |
| 77 | + xbps-install -Syu || xbps-install -yu xbps |
| 78 | + # Upgrade again (in case there was a xbps update) |
| 79 | + xbps-install -yu |
| 80 | + # Install depedencies |
| 81 | + xbps-install -yu bash make git kmod xz lzo qemu-user-static outils dosfstools e2fsprogs |
| 82 | +
|
| 83 | + - name: Clone and checkout |
| 84 | + uses: classabbyamp/treeless-checkout-action@v1 |
| 85 | + - name: Prepare environment |
| 86 | + run: | |
| 87 | + echo "DATECODE=$(date -u "+%Y%m%d")" >> $GITHUB_ENV |
| 88 | + echo "MKLIVE_REV=${GITHUB_SHA:0:8}" >> $GITHUB_ENV |
| 89 | + - name: Build live ISOs |
| 90 | + run: | |
| 91 | + if ! [[ "$LIVE_ARCHS" = "none" || "$LIVE_FLAVORS" = "none" ]]; then |
| 92 | + make live-iso-all{-print,} \ |
| 93 | + LIVE_ARCHS="$LIVE_ARCHS" LIVE_FLAVORS="$LIVE_FLAVORS" \ |
| 94 | + SUDO= REPOSITORY="$REPO" DATECODE=$DATECODE |
| 95 | + else |
| 96 | + echo "Nothing to do..." |
| 97 | + fi |
| 98 | + - name: Build ROOTFSes |
| 99 | + run: | |
| 100 | + if ! [ "$ROOTFS_ARCHS" = "none" ]; then |
| 101 | + make rootfs-all{-print,} \ |
| 102 | + SUDO= ARCHS="$ROOTFS_ARCHS" REPOSITORY="$REPO" DATECODE=$DATECODE |
| 103 | + else |
| 104 | + echo "Nothing to do..." |
| 105 | + fi |
| 106 | + - name: Build PLATFORMFSes |
| 107 | + run: | |
| 108 | + if ! [ "$PLATFORMS" = "none" ]; then |
| 109 | + make platformfs-all{-print,} \ |
| 110 | + SUDO= PLATFORMS="$PLATFORMS" REPOSITORY="$REPO" DATECODE=$DATECODE |
| 111 | + else |
| 112 | + echo "Nothing to do..." |
| 113 | + fi |
| 114 | + - name: Build SBC images |
| 115 | + run: | |
| 116 | + if ! [ "$SBC_IMGS" = "none" ]; then |
| 117 | + make images-all-sbc{-print,} \ |
| 118 | + SUDO= SBC_IMGS="$SBC_IMGS" REPOSITORY="$REPO" DATECODE=$DATECODE |
| 119 | + else |
| 120 | + echo "Nothing to do..." |
| 121 | + fi |
| 122 | + - name: Prepare artifacts for upload |
| 123 | + run: | |
| 124 | + make dist checksum DATECODE=$DATECODE |
| 125 | + - name: Upload artifacts |
| 126 | + uses: actions/upload-artifact@v3 |
| 127 | + with: |
| 128 | + name: void-live-${{ env.DATECODE }} |
| 129 | + path: distdir-${{ env.DATECODE }}/* |
| 130 | + if-no-files-found: error |
0 commit comments