ci: use environment files in actions (#4338)

This commit is contained in:
openoms 2023-12-23 11:48:26 +01:00 committed by GitHub
parent a7ae5162e7
commit 4d8776a35c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 35 deletions

View file

@ -56,7 +56,6 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set values - name: Set values
id: set_values
run: | run: |
echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV
@ -66,19 +65,18 @@ jobs:
echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
fi fi
if [[ "${{github.event_name}}" == "pull_request" ]]; then 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 else
echo "::set-output name=github_user::$(echo ${{github.repository}} | cut -d'/' -f1)" echo "github_user=$(echo ${{github.repository}} | cut -d'/' -f1)" >> $GITHUB_OUTPUT
fi
- name: Display the build name - name: Display the build name
run: echo "Building the raspiblitz-amd64-debian-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}" run: echo "Building the raspiblitz-amd64-debian-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}"
- name: Run the build script - name: Run the build script
run: | 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 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 - name: Compute checksum of the raw image
run: | run: |

View file

@ -7,7 +7,7 @@ concurrency:
on: on:
workflow_dispatch: workflow_dispatch:
push: push:
branches: ["dev", "v1.10"] branches: ["dev", "v1.10", "v1.11"]
paths: paths:
- "build_sdcard.sh" - "build_sdcard.sh"
- "home.admin/bitcoin.install.sh" - "home.admin/bitcoin.install.sh"
@ -34,7 +34,6 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set values - name: Set values
id: set_values
run: | run: |
echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV
@ -44,19 +43,18 @@ jobs:
echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
fi fi
if [[ "${{github.event_name}}" == "pull_request" ]]; then 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 else
echo "::set-output name=github_user::$(echo ${{github.repository}} | cut -d'/' -f1)" echo "github_user=$(echo ${{github.repository}} | cut -d'/' -f1)" >> $GITHUB_OUTPUT
fi
- name: Display the build name - name: Display the build name
run: echo "Building the raspiblitz-amd64-debian-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}" run: echo "Building the raspiblitz-amd64-debian-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}"
- name: Run the build script - name: Run the build script
run: | 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 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 - name: Compute checksum of the raw image
run: | run: |
@ -80,4 +78,4 @@ jobs:
path: | 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.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
${{github.workspace}}/ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu/raspiblitz-amd64-debian-lean.qcow2.gz.sha256 ${{github.workspace}}/

View file

@ -7,7 +7,7 @@ concurrency:
on: on:
workflow_dispatch: workflow_dispatch:
push: push:
branches: ["dev", "v1.10"] branches: ["dev", "v1.10", "v1.11"]
paths: paths:
- "build_sdcard.sh" - "build_sdcard.sh"
- "home.admin/bitcoin.install.sh" - "home.admin/bitcoin.install.sh"
@ -34,7 +34,6 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set values - name: Set values
id: set_values
run: | run: |
echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV
@ -44,19 +43,18 @@ jobs:
echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
fi fi
if [[ "${{github.event_name}}" == "pull_request" ]]; then 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 else
echo "::set-output name=github_user::$(echo ${{github.repository}} | cut -d'/' -f1)" echo "github_user=$(echo ${{github.repository}} | cut -d'/' -f1)" >> $GITHUB_OUTPUT
fi
- name: Display the build name - name: Display the build name
run: echo "Building the raspiblitz-amd64-debian-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}" run: echo "Building the raspiblitz-amd64-debian-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}"
- name: Run the build script - name: Run the build script
run: | 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 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 - name: Compute checksum of the raw image
run: | run: |
@ -80,4 +78,4 @@ jobs:
path: | 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.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
${{github.workspace}}/ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu/raspiblitz-amd64-debian-lean.qcow2.gz.sha256 ${{github.workspace}}/ci/amd64/builds/raspiblitz-amd

View file

@ -56,7 +56,6 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set values - name: Set values
id: set_values
run: | run: |
echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV
@ -66,19 +65,18 @@ jobs:
echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
fi fi
if [[ "${{github.event_name}}" == "pull_request" ]]; then 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 else
echo "::set-output name=github_user::$(echo ${{github.repository}} | cut -d'/' -f1)" echo "github_user=$(echo ${{github.repository}} | cut -d'/' -f1)" >> $GITHUB_OUTPUT
fi
- name: Display the build name - name: Display the build name
run: echo "Building the raspiblitz-arm64-rpi-fatpack-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}" run: echo "Building the raspiblitz-arm64-rpi-fatpack-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}"
- name: Run the build script - name: Run the build script
run: | 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 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 - name: Compute checksum of the raw image
run: | run: |

View file

@ -7,7 +7,7 @@ concurrency:
on: on:
workflow_dispatch: workflow_dispatch:
push: push:
branches: ["dev", "v1.10"] branches: ["dev", "v1.10", "v1.11"]
paths: paths:
- "build_sdcard.sh" - "build_sdcard.sh"
- "home.admin/bitcoin.install.sh" - "home.admin/bitcoin.install.sh"
@ -34,7 +34,6 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set values - name: Set values
id: set_values
run: | run: |
echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV
@ -44,19 +43,18 @@ jobs:
echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
fi fi
if [[ "${{github.event_name}}" == "pull_request" ]]; then 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 else
echo "::set-output name=github_user::$(echo ${{github.repository}} | cut -d'/' -f1)" echo "github_user=$(echo ${{github.repository}} | cut -d'/' -f1)" >> $GITHUB_OUTPUT
fi
- name: Display the build name - name: Display the build name
run: echo "Building the raspiblitz-arm64-rpi-lean-image-${{ env.BUILD_DATE }}-${{ env.BUILD_VERSION }}" run: echo "Building the raspiblitz-arm64-rpi-lean-image-${{ env.BUILD_DATE }}-${{ env.BUILD_VERSION }}"
- name: Run the build script - name: Run the build script
run: | 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 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 - name: Compute checksum of the raw image
run: | run: |