diff --git a/.github/workflows/amd64-fatpack-image.yml b/.github/workflows/amd64-fatpack-image.yml index 8b4207539..ccd07e249 100644 --- a/.github/workflows/amd64-fatpack-image.yml +++ b/.github/workflows/amd64-fatpack-image.yml @@ -59,14 +59,20 @@ jobs: run: | echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV + if [ -z "$GITHUB_HEAD_REF" ]; then + echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + else + echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV + fi - name: Hello RaspiBlitz run: echo "Building the raspiblitz-amd64-debian-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}" - name: Run the build script run: | + echo "Using the variables: --pack fatpack --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi--desktop gnome" cd ci/amd64 - bash packer.build.amd64-debian.sh --pack fatpack --github_user $GITHUB_ACTOR --branch $GITHUB_HEAD_REF --preseed_file preseed.cfg --boot uefi--desktop gnome + bash packer.build.amd64-debian.sh --pack fatpack --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi--desktop gnome - name: Compute checksum of the raw image run: | diff --git a/.github/workflows/amd64-lean-image.yml b/.github/workflows/amd64-lean-image.yml index f36059778..8e1c8fdae 100644 --- a/.github/workflows/amd64-lean-image.yml +++ b/.github/workflows/amd64-lean-image.yml @@ -37,14 +37,19 @@ jobs: run: | echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV - + if [ -z "$GITHUB_HEAD_REF" ]; then + echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + else + echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV + fi - name: Hello RaspiBlitz run: echo "Building the raspiblitz-amd64-debian-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}" - name: Run the build script run: | + echo "Using the variables: --pack lean --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop gnome" cd ci/amd64 - bash packer.build.amd64-debian.sh --pack lean --github_user $GITHUB_ACTOR --branch $GITHUB_HEAD_REF --preseed_file preseed.cfg --boot uefi --desktop gnome + bash packer.build.amd64-debian.sh --pack lean --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop gnome - name: Compute checksum of the raw image run: | diff --git a/.github/workflows/amd64-lean-legacyboot-image.yml b/.github/workflows/amd64-lean-legacyboot-image.yml index 7fa20f049..ea14120a1 100644 --- a/.github/workflows/amd64-lean-legacyboot-image.yml +++ b/.github/workflows/amd64-lean-legacyboot-image.yml @@ -37,14 +37,20 @@ jobs: run: | echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV + if [ -z "$GITHUB_HEAD_REF" ]; then + echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + else + echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV + fi - name: Hello RaspiBlitz run: echo "Building the raspiblitz-amd64-debian-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}" - name: Run the build script run: | + echo "Using the variables: --pack lean --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot bios --desktop none" cd ci/amd64 - bash packer.build.amd64-debian.sh --pack lean --github_user $GITHUB_ACTOR --branch $GITHUB_HEAD_REF --preseed_file preseed.cfg --boot bios --desktop none + bash packer.build.amd64-debian.sh --pack lean --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot bios --desktop none - name: Compute checksum of the raw image run: | diff --git a/.github/workflows/arm64-rpi-debian12-lean-image.yml b/.github/workflows/arm64-rpi-debian12-lean-image.yml index 56c2c416d..ec4c7408d 100644 --- a/.github/workflows/arm64-rpi-debian12-lean-image.yml +++ b/.github/workflows/arm64-rpi-debian12-lean-image.yml @@ -37,14 +37,20 @@ jobs: run: | echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV + if [ -z "$GITHUB_HEAD_REF" ]; then + echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + else + echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV + fi - name: Hello Raspiblitz run: echo "Building the raspiblitz-arm64-rpi-lean-image-${{ env.BUILD_DATE }}-${{ env.BUILD_VERSION }}" - name: Run the build script run: | + echo "Using the variables: --pack lean --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}} --image_link https://raspi.debian.net/tested/20230612_raspi_4_bookworm.img.xz --image_checksum a68cd2bfe7831c438d8a5d832803ae0db17afec9f3cd370d9e8748c7b5456283" cd ci/arm64-rpi - bash packer.build.arm64-rpi.sh "lean" "$GITHUB_ACTOR" "$GITHUB_HEAD_REF" "https://raspi.debian.net/tested/20230612_raspi_4_bookworm.img.xz" "a68cd2bfe7831c438d8a5d832803ae0db17afec9f3cd370d9e8748c7b5456283" + bash packer.build.arm64-rpi.sh --pack lean --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}} --image_link https://raspi.debian.net/tested/20230612_raspi_4_bookworm.img.xz --image_checksum a68cd2bfe7831c438d8a5d832803ae0db17afec9f3cd370d9e8748c7b5456283 - name: Compute checksum of the raw image run: | diff --git a/.github/workflows/arm64-rpi-fatpack-image.yml b/.github/workflows/arm64-rpi-fatpack-image.yml index 607099799..a084cbe99 100644 --- a/.github/workflows/arm64-rpi-fatpack-image.yml +++ b/.github/workflows/arm64-rpi-fatpack-image.yml @@ -59,14 +59,20 @@ jobs: run: | echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV + if [ -z "$GITHUB_HEAD_REF" ]; then + echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + else + echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV + fi - name: Hello Raspiblitz run: echo "Building the raspiblitz-arm64-rpi-fatpack-image-${{ env.BUILD_DATE }}-${{ env.BUILD_VERSION }}" - name: Run the build script run: | + echo "Using the variables: --pack fatpack --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}}" cd ci/arm64-rpi - bash packer.build.arm64-rpi.sh fatpack $GITHUB_ACTOR $GITHUB_HEAD_REF + bash packer.build.arm64-rpi.sh --pack fatpack --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}} - name: Compute checksum of the raw image run: | diff --git a/.github/workflows/arm64-rpi-lean-image.yml b/.github/workflows/arm64-rpi-lean-image.yml index 3480388eb..044843c07 100644 --- a/.github/workflows/arm64-rpi-lean-image.yml +++ b/.github/workflows/arm64-rpi-lean-image.yml @@ -37,14 +37,20 @@ jobs: run: | echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV + if [ -z "$GITHUB_HEAD_REF" ]; then + echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + else + echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV + fi - name: Hello Raspiblitz run: echo "Building the raspiblitz-arm64-rpi-lean-image-${{ env.BUILD_DATE }}-${{ env.BUILD_VERSION }}" - name: Run the build script run: | + echo "Using the variables: --pack lean --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}}" cd ci/arm64-rpi - bash packer.build.arm64-rpi.sh lean $GITHUB_ACTOR $GITHUB_HEAD_REF + bash packer.build.arm64-rpi.sh --pack lean --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}} - name: Compute checksum of the raw image run: | diff --git a/ci/arm64-rpi/packer.build.arm64-rpi.local.sh b/ci/arm64-rpi/packer.build.arm64-rpi.local.sh index 8cea7b821..45a411850 100644 --- a/ci/arm64-rpi/packer.build.arm64-rpi.local.sh +++ b/ci/arm64-rpi/packer.build.arm64-rpi.local.sh @@ -58,7 +58,8 @@ go mod download go build || exit 1 # set vars -source <(../set_variables.sh "$@") +source ../set_variables.sh +set_variables "$@" cp ../build.arm64-rpi.pkr.hcl ./ cp ../build.raspiblitz.sh ./ diff --git a/ci/arm64-rpi/packer.build.arm64-rpi.sh b/ci/arm64-rpi/packer.build.arm64-rpi.sh index 5d4a6b857..e6dfa053e 100644 --- a/ci/arm64-rpi/packer.build.arm64-rpi.sh +++ b/ci/arm64-rpi/packer.build.arm64-rpi.sh @@ -1,7 +1,8 @@ #!/bin/bash -e # set vars -source <(../set_variables.sh "$@") +source ../set_variables.sh +set_variables "$@" # build the image in docker echo -e "\nBuild the image..."