From 4d8776a35c94020db5da1cfe0a7454e9024ba321 Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Sat, 23 Dec 2023 11:48:26 +0100 Subject: [PATCH] ci: use environment files in actions (#4338) --- .github/workflows/amd64-fatpack-image.yml | 10 ++++------ .github/workflows/amd64-lean-image.yml | 14 ++++++-------- .github/workflows/amd64-lean-legacyboot-image.yml | 14 ++++++-------- .github/workflows/arm64-rpi-fatpack-image.yml | 10 ++++------ .github/workflows/arm64-rpi-lean-image.yml | 12 +++++------- 5 files changed, 25 insertions(+), 35 deletions(-) diff --git a/.github/workflows/amd64-fatpack-image.yml b/.github/workflows/amd64-fatpack-image.yml index 83631f838..5df7423f7 100644 --- a/.github/workflows/amd64-fatpack-image.yml +++ b/.github/workflows/amd64-fatpack-image.yml @@ -56,7 +56,6 @@ jobs: - uses: actions/checkout@v3 - name: Set values - id: set_values run: | echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV @@ -66,19 +65,18 @@ jobs: echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV fi if [[ "${{github.event_name}}" == "pull_request" ]]; then - echo "::set-output name=github_user::${{github.event.pull_request.head.repo.owner.login}}" + echo "github_user=${{github.event.pull_request.head.repo.owner.login}}" >> $GITHUB_OUTPUT else - echo "::set-output name=github_user::$(echo ${{github.repository}} | cut -d'/' -f1)" - fi + echo "github_user=$(echo ${{github.repository}} | cut -d'/' -f1)" >> $GITHUB_OUTPUT - name: Display the build name 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 ${{steps.set_values.outputs.github_user}} --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop none" + echo "Using the variables: --pack fatpack --github_user $(cat $GITHUB_OUTPUT) --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop none" cd ci/amd64 - bash packer.build.amd64-debian.sh --pack fatpack --github_user ${{steps.set_values.outputs.github_user}} --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop none + bash packer.build.amd64-debian.sh --pack fatpack --github_user $(cat $GITHUB_OUTPUT) --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop none - 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 e384f6a08..7335ef28d 100644 --- a/.github/workflows/amd64-lean-image.yml +++ b/.github/workflows/amd64-lean-image.yml @@ -7,7 +7,7 @@ concurrency: on: workflow_dispatch: push: - branches: ["dev", "v1.10"] + branches: ["dev", "v1.10", "v1.11"] paths: - "build_sdcard.sh" - "home.admin/bitcoin.install.sh" @@ -34,7 +34,6 @@ jobs: - uses: actions/checkout@v3 - name: Set values - id: set_values run: | echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV @@ -44,19 +43,18 @@ jobs: echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV fi if [[ "${{github.event_name}}" == "pull_request" ]]; then - echo "::set-output name=github_user::${{github.event.pull_request.head.repo.owner.login}}" + echo "github_user=${{github.event.pull_request.head.repo.owner.login}}" >> $GITHUB_OUTPUT else - echo "::set-output name=github_user::$(echo ${{github.repository}} | cut -d'/' -f1)" - fi + echo "github_user=$(echo ${{github.repository}} | cut -d'/' -f1)" >> $GITHUB_OUTPUT - name: Display the build name 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 ${{steps.set_values.outputs.github_user}} --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop gnome" + echo "Using the variables: --pack lean --github_user $(cat $GITHUB_OUTPUT) --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 ${{steps.set_values.outputs.github_user}} --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop gnome + bash packer.build.amd64-debian.sh --pack lean --github_user $(cat $GITHUB_OUTPUT) --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop gnome - name: Compute checksum of the raw image run: | @@ -80,4 +78,4 @@ jobs: path: | ${{github.workspace}}/ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu/raspiblitz-amd64-debian-lean.qcow2.sha256 ${{github.workspace}}/ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu/raspiblitz-amd64-debian-lean.qcow2.gz - ${{github.workspace}}/ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu/raspiblitz-amd64-debian-lean.qcow2.gz.sha256 + ${{github.workspace}}/ diff --git a/.github/workflows/amd64-lean-legacyboot-image.yml b/.github/workflows/amd64-lean-legacyboot-image.yml index 4a361fa79..9569eb0da 100644 --- a/.github/workflows/amd64-lean-legacyboot-image.yml +++ b/.github/workflows/amd64-lean-legacyboot-image.yml @@ -7,7 +7,7 @@ concurrency: on: workflow_dispatch: push: - branches: ["dev", "v1.10"] + branches: ["dev", "v1.10", "v1.11"] paths: - "build_sdcard.sh" - "home.admin/bitcoin.install.sh" @@ -34,7 +34,6 @@ jobs: - uses: actions/checkout@v3 - name: Set values - id: set_values run: | echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV @@ -44,19 +43,18 @@ jobs: echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV fi if [[ "${{github.event_name}}" == "pull_request" ]]; then - echo "::set-output name=github_user::${{github.event.pull_request.head.repo.owner.login}}" + echo "github_user=${{github.event.pull_request.head.repo.owner.login}}" >> $GITHUB_OUTPUT else - echo "::set-output name=github_user::$(echo ${{github.repository}} | cut -d'/' -f1)" - fi + echo "github_user=$(echo ${{github.repository}} | cut -d'/' -f1)" >> $GITHUB_OUTPUT - name: Display the build name 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 ${{steps.set_values.outputs.github_user}} --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot bios --desktop none" + echo "Using the variables: --pack lean --github_user $(cat $GITHUB_OUTPUT) --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 ${{steps.set_values.outputs.github_user}} --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot bios --desktop none + bash packer.build.amd64-debian.sh --pack lean --github_user $(cat $GITHUB_OUTPUT) --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot bios --desktop none - name: Compute checksum of the raw image run: | @@ -80,4 +78,4 @@ jobs: path: | ${{github.workspace}}/ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu/raspiblitz-amd64-debian-lean.qcow2.sha256 ${{github.workspace}}/ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu/raspiblitz-amd64-debian-lean.qcow2.gz - ${{github.workspace}}/ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu/raspiblitz-amd64-debian-lean.qcow2.gz.sha256 + ${{github.workspace}}/ci/amd64/builds/raspiblitz-amd diff --git a/.github/workflows/arm64-rpi-fatpack-image.yml b/.github/workflows/arm64-rpi-fatpack-image.yml index b44a7ad90..2fdd22dbe 100644 --- a/.github/workflows/arm64-rpi-fatpack-image.yml +++ b/.github/workflows/arm64-rpi-fatpack-image.yml @@ -56,7 +56,6 @@ jobs: - uses: actions/checkout@v3 - name: Set values - id: set_values run: | echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV @@ -66,19 +65,18 @@ jobs: echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV fi if [[ "${{github.event_name}}" == "pull_request" ]]; then - echo "::set-output name=github_user::${{github.event.pull_request.head.repo.owner.login}}" + echo "github_user=${{github.event.pull_request.head.repo.owner.login}}" >> $GITHUB_OUTPUT else - echo "::set-output name=github_user::$(echo ${{github.repository}} | cut -d'/' -f1)" - fi + echo "github_user=$(echo ${{github.repository}} | cut -d'/' -f1)" >> $GITHUB_OUTPUT - name: Display the build name 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 ${{steps.set_values.outputs.github_user}} --branch ${{env.BRANCH_NAME}}" + echo "Using the variables: --pack fatpack --github_user $(cat $GITHUB_OUTPUT) --branch ${{env.BRANCH_NAME}}" cd ci/arm64-rpi - bash packer.build.arm64-rpi.sh --pack fatpack --github_user ${{steps.set_values.outputs.github_user}} --branch ${{env.BRANCH_NAME}} + bash packer.build.arm64-rpi.sh --pack fatpack --github_user $(cat $GITHUB_OUTPUT) --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 212147f65..9ba6eade6 100644 --- a/.github/workflows/arm64-rpi-lean-image.yml +++ b/.github/workflows/arm64-rpi-lean-image.yml @@ -7,7 +7,7 @@ concurrency: on: workflow_dispatch: push: - branches: ["dev", "v1.10"] + branches: ["dev", "v1.10", "v1.11"] paths: - "build_sdcard.sh" - "home.admin/bitcoin.install.sh" @@ -34,7 +34,6 @@ jobs: - uses: actions/checkout@v3 - name: Set values - id: set_values run: | echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV @@ -44,19 +43,18 @@ jobs: echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV fi if [[ "${{github.event_name}}" == "pull_request" ]]; then - echo "::set-output name=github_user::${{github.event.pull_request.head.repo.owner.login}}" + echo "github_user=${{github.event.pull_request.head.repo.owner.login}}" >> $GITHUB_OUTPUT else - echo "::set-output name=github_user::$(echo ${{github.repository}} | cut -d'/' -f1)" - fi + echo "github_user=$(echo ${{github.repository}} | cut -d'/' -f1)" >> $GITHUB_OUTPUT - name: Display the build name 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 ${{steps.set_values.outputs.github_user}} --branch ${{env.BRANCH_NAME}}" + echo "Using the variables: --pack lean --github_user $(cat $GITHUB_OUTPUT) --branch ${{env.BRANCH_NAME}}" cd ci/arm64-rpi - bash packer.build.arm64-rpi.sh --pack lean --github_user ${{steps.set_values.outputs.github_user}} --branch ${{env.BRANCH_NAME}} + bash packer.build.arm64-rpi.sh --pack lean --github_user $(cat $GITHUB_OUTPUT) --branch ${{env.BRANCH_NAME}} - name: Compute checksum of the raw image run: |