From ec68b67444e7010bd34b9b1db7d682741333ddec Mon Sep 17 00:00:00 2001 From: Warfront1 <1920038+Warfront1@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:14:15 -0400 Subject: [PATCH 1/3] Move dynamic build variables into .env file --- .github/workflows/ci-cd.yml | 12 +++++++----- .github/workflows/manual-update.yml | 9 ++++++--- build.config | 2 ++ 3 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 build.config diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index d317818..5302b2d 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -8,8 +8,6 @@ on: env: DOCKER_REPO: ${{ vars.DOCKER_USERNAME }}/clonezilla - URL: https://sourceforge.net/projects/clonezilla/files/clonezilla_live_stable/3.2.1-28/clonezilla-live-3.2.1-28-amd64.iso - UPLOAD_LATEST: true jobs: build_and_deploy: @@ -17,10 +15,14 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Read config from clonezilla.env + run: | + cat clonezilla.env >> $GITHUB_ENV + - name: Build Docker Container run: | TMPDIR=$(mktemp -d) - sudo ./src/main/scripts/build.sh --dir=${TMPDIR} --url=${URL} --docker-repo=${DOCKER_REPO} + sudo ./src/main/scripts/build.sh --dir=${TMPDIR} --url=${{ env.URL }} --docker-repo=${DOCKER_REPO} - name: Log in to Docker Hub uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a @@ -32,6 +34,6 @@ jobs: shell: bash run: | docker images - [ "${UPLOAD_LATEST}" = false ] && docker rmi ${DOCKER_REPO}:latest + [ "${{ env.UPLOAD_LATEST }}" = false ] && docker rmi ${DOCKER_REPO}:latest docker push ${DOCKER_REPO} --all-tags - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' \ No newline at end of file diff --git a/.github/workflows/manual-update.yml b/.github/workflows/manual-update.yml index d45fb37..41b84fe 100644 --- a/.github/workflows/manual-update.yml +++ b/.github/workflows/manual-update.yml @@ -20,9 +20,9 @@ jobs: VERSION=$(basename "${{ github.event.inputs.url }}" | sed -e 's/clonezilla-live-//' -e 's/-amd64.iso//') echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT - - name: Update ci-cd.yml + - name: Update configuration file run: | - sed -i 's| URL:.*| URL: ${{ github.event.inputs.url }}|' .github/workflows/ci-cd.yml + sed -i 's|^URL=.*|URL=${{ github.event.inputs.url }}|' clonezilla.env - name: Create Pull Request uses: peter-evans/create-pull-request@v6 @@ -30,6 +30,9 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} commit-message: "Update Clonezilla to ${{ steps.parse_version.outputs.VERSION }}" title: "Update to Clonezilla ${{ steps.parse_version.outputs.VERSION }}" - body: "This PR updates the Clonezilla version to `${{ steps.parse_version.outputs.VERSION }}`." + body: | + This PR updates the Clonezilla version to `${{ steps.parse_version.outputs.VERSION }}`. + + The `clonezilla.env` configuration file has been updated. branch: "feat/clonezilla-${{ steps.parse_version.outputs.VERSION }}" base: main \ No newline at end of file diff --git a/build.config b/build.config new file mode 100644 index 0000000..a3cb4a6 --- /dev/null +++ b/build.config @@ -0,0 +1,2 @@ +URL: https://sourceforge.net/projects/clonezilla/files/clonezilla_live_stable/3.2.1-28/clonezilla-live-3.2.1-28-amd64.iso +UPLOAD_LATEST: true \ No newline at end of file From c5cb85dd9bb47e5f3e9eac599efed52f46f0b0ad Mon Sep 17 00:00:00 2001 From: Warfront1 <1920038+Warfront1@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:17:09 -0400 Subject: [PATCH 2/3] Fix .env filename --- .github/workflows/ci-cd.yml | 4 ++-- .github/workflows/manual-update.yml | 4 ++-- build.config => build.env | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename build.config => build.env (100%) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 5302b2d..10d3e8f 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -15,9 +15,9 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Read config from clonezilla.env + - name: Read config from build.env run: | - cat clonezilla.env >> $GITHUB_ENV + cat build.env >> $GITHUB_ENV - name: Build Docker Container run: | diff --git a/.github/workflows/manual-update.yml b/.github/workflows/manual-update.yml index 41b84fe..6ef9671 100644 --- a/.github/workflows/manual-update.yml +++ b/.github/workflows/manual-update.yml @@ -22,7 +22,7 @@ jobs: - name: Update configuration file run: | - sed -i 's|^URL=.*|URL=${{ github.event.inputs.url }}|' clonezilla.env + sed -i 's|^URL=.*|URL=${{ github.event.inputs.url }}|' build.env - name: Create Pull Request uses: peter-evans/create-pull-request@v6 @@ -33,6 +33,6 @@ jobs: body: | This PR updates the Clonezilla version to `${{ steps.parse_version.outputs.VERSION }}`. - The `clonezilla.env` configuration file has been updated. + The `build.env` configuration file has been updated. branch: "feat/clonezilla-${{ steps.parse_version.outputs.VERSION }}" base: main \ No newline at end of file diff --git a/build.config b/build.env similarity index 100% rename from build.config rename to build.env From 7b88f185572595f5592815be588127fc5605d771 Mon Sep 17 00:00:00 2001 From: Warfront1 <1920038+Warfront1@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:19:25 -0400 Subject: [PATCH 3/3] Update build.env --- build.env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.env b/build.env index a3cb4a6..b355da6 100644 --- a/build.env +++ b/build.env @@ -1,2 +1,2 @@ -URL: https://sourceforge.net/projects/clonezilla/files/clonezilla_live_stable/3.2.1-28/clonezilla-live-3.2.1-28-amd64.iso -UPLOAD_LATEST: true \ No newline at end of file +URL=https://sourceforge.net/projects/clonezilla/files/clonezilla_live_stable/3.2.1-28/clonezilla-live-3.2.1-28-amd64.iso +UPLOAD_LATEST=true \ No newline at end of file