From d8a0266e43387947b2fc08aba0abb2189af9c652 Mon Sep 17 00:00:00 2001 From: Mirko Brombin Date: Mon, 29 Jul 2024 22:41:52 +0200 Subject: [PATCH 01/11] chore: enable CI for dev branch --- .github/workflows/vib-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vib-build.yml b/.github/workflows/vib-build.yml index a8a0e2d..f2e633e 100644 --- a/.github/workflows/vib-build.yml +++ b/.github/workflows/vib-build.yml @@ -3,7 +3,7 @@ name: Vib Build on: push: branches: - - 'main' + - 'dev' tags: - '*' workflow_dispatch: From e01939ab05df96c2426d62946195ddab13dcc9a1 Mon Sep 17 00:00:00 2001 From: Mirko Brombin Date: Sun, 4 Aug 2024 21:32:30 +0200 Subject: [PATCH 02/11] chore: switch to testing repo --- rootfs/build.sh | 2 +- .../includes.rootfs/etc/apt/sources.list.d/vanilla-base.sources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rootfs/build.sh b/rootfs/build.sh index 0332fe9..4ce4ab1 100644 --- a/rootfs/build.sh +++ b/rootfs/build.sh @@ -2,7 +2,7 @@ # Rootfs definitions ROOTFS_NAME="vanilla-pico" -REPO_URL=http://repo2.vanillaos.org +REPO_URL=http://testing.vanillaos.org REPO_KEY=vanilla.key CUSTOM_PACKAGE="" CLEANUP_DIRS="/usr/share/doc/* diff --git a/rootfs/includes.rootfs/etc/apt/sources.list.d/vanilla-base.sources b/rootfs/includes.rootfs/etc/apt/sources.list.d/vanilla-base.sources index ff57ac8..6529c19 100644 --- a/rootfs/includes.rootfs/etc/apt/sources.list.d/vanilla-base.sources +++ b/rootfs/includes.rootfs/etc/apt/sources.list.d/vanilla-base.sources @@ -1,5 +1,5 @@ Types: deb -URIs: http://repo2.vanillaos.org/ +URIs: http://testing.vanillaos.org/ Suites: sid Architectures: amd64 Components: main contrib non-free non-free-firmware From 30338da2371a7791c55d957d41d6aa7985b6471d Mon Sep 17 00:00:00 2001 From: Tau Date: Mon, 5 Aug 2024 19:31:03 +0000 Subject: [PATCH 03/11] build main image on tag --- .github/workflows/vib-build.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vib-build.yml b/.github/workflows/vib-build.yml index f2e633e..b6e8394 100644 --- a/.github/workflows/vib-build.yml +++ b/.github/workflows/vib-build.yml @@ -45,6 +45,15 @@ jobs: echo "REPO_OWNER_LOWERCASE=$REPO_OWNER_LOWERCASE" >> "$GITHUB_ENV" echo "IMAGE_URL=ghcr.io/$REPO_OWNER_LOWERCASE/pico" >> "$GITHUB_ENV" + - name: Extra image tag branch + if: ${{ github.ref_type != 'tag' }} + run: | + echo "EXTRA_TAG=ref,event=branch" >> "$GITHUB_ENV" + - name: Extra image tag release + if: ${{ github.ref_type == 'tag' }} + run: | + echo "EXTRA_TAG=raw,main" >> "$GITHUB_ENV" + - name: Docker meta id: docker_meta uses: docker/metadata-action@v5 @@ -56,7 +65,7 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{raw}} type=semver,pattern=v{{major}} - type=ref,event=branch + type=${{ env.EXTRA_TAG }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 From bb5374f0fa35282cb297c463e4a3ff99b6f73a73 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 11:55:53 +0000 Subject: [PATCH 04/11] build(deps): bump vanilla-os/vib-gh-action from 0.7.4 to 0.8.1 Bumps [vanilla-os/vib-gh-action](https://github.com/vanilla-os/vib-gh-action) from 0.7.4 to 0.8.1. - [Release notes](https://github.com/vanilla-os/vib-gh-action/releases) - [Commits](https://github.com/vanilla-os/vib-gh-action/compare/v0.7.4...v0.8.1) --- updated-dependencies: - dependency-name: vanilla-os/vib-gh-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/release.yml | 2 +- .github/workflows/vib-build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ddec9a2..4120726 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: sudo apt install -y podman sudo sh build.sh - - uses: vanilla-os/vib-gh-action@v0.7.4 + - uses: vanilla-os/vib-gh-action@v0.8.1 - name: Create Checksum working-directory: rootfs diff --git a/.github/workflows/vib-build.yml b/.github/workflows/vib-build.yml index b6e8394..237932e 100644 --- a/.github/workflows/vib-build.yml +++ b/.github/workflows/vib-build.yml @@ -37,7 +37,7 @@ jobs: sudo apt install -y podman sudo sh build.sh - - uses: vanilla-os/vib-gh-action@v0.7.4 + - uses: vanilla-os/vib-gh-action@v0.8.1 - name: Generate image name run: | From 2f11044fcb13027c1266657a2a86022ded833324 Mon Sep 17 00:00:00 2001 From: "K.B.Dharun Krishna" Date: Tue, 17 Sep 2024 23:05:02 +0530 Subject: [PATCH 05/11] cleanup: minor fixes to CI --- .github/workflows/vib-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vib-build.yml b/.github/workflows/vib-build.yml index 237932e..8906e3d 100644 --- a/.github/workflows/vib-build.yml +++ b/.github/workflows/vib-build.yml @@ -49,6 +49,7 @@ jobs: if: ${{ github.ref_type != 'tag' }} run: | echo "EXTRA_TAG=ref,event=branch" >> "$GITHUB_ENV" + - name: Extra image tag release if: ${{ github.ref_type == 'tag' }} run: | @@ -112,7 +113,6 @@ jobs: path: rootfs/vanilla-pico.tar.zst - uses: softprops/action-gh-release@v2 - if: github.repository == 'vanilla-os/pico-image' && github.ref == 'refs/heads/main' with: token: "${{ secrets.GITHUB_TOKEN }}" tag_name: "continuous" From b0cf11d160ff5e4502c6bc6aeb28f8137e49b7f5 Mon Sep 17 00:00:00 2001 From: "K.B.Dharun Krishna" Date: Thu, 19 Sep 2024 15:02:25 +0530 Subject: [PATCH 06/11] feat: swap repository URL on tag Signed-off-by: K.B.Dharun Krishna --- .github/workflows/vib-build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/vib-build.yml b/.github/workflows/vib-build.yml index 8906e3d..ff1bead 100644 --- a/.github/workflows/vib-build.yml +++ b/.github/workflows/vib-build.yml @@ -31,6 +31,12 @@ jobs: sudo chmod a+x /debootstrap/debootstrap sudo ln -s /debootstrap/debootstrap -t /usr/local/bin + - name: Replace testing repository with production + if: ${{ github.ref_type == 'tag' }} + run: | + sed 's|http://testing.vanillaos.org|http://repo2.vanillaos.org|g' -i rootfs/build.sh + sed 's|http://testing.vanillaos.org|http://repo2.vanillaos.org|g' -i rootfs/includes.rootfs/etc/apt/sources.list.d/vanilla-base.sources + - name: Rootfs working-directory: rootfs run: | From 95d9fcf9656732064abbcb54c6091b8047616b8a Mon Sep 17 00:00:00 2001 From: Tau Date: Wed, 6 Nov 2024 17:37:56 +0100 Subject: [PATCH 07/11] return error when build script fails --- rootfs/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rootfs/build.sh b/rootfs/build.sh index 4ce4ab1..5b87a9c 100644 --- a/rootfs/build.sh +++ b/rootfs/build.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + # Rootfs definitions ROOTFS_NAME="vanilla-pico" REPO_URL=http://testing.vanillaos.org From 418da75424d9242e772480c3d54277b75a4324ca Mon Sep 17 00:00:00 2001 From: "K.B.Dharun Krishna" Date: Wed, 6 Nov 2024 21:34:50 +0530 Subject: [PATCH 08/11] fu: make differ run as job only on tags Signed-off-by: K.B.Dharun Krishna --- .github/workflows/differ.yml | 31 --------------------------- .github/workflows/vib-build.yml | 37 +++++++++++++++++++++++++++------ 2 files changed, 31 insertions(+), 37 deletions(-) delete mode 100644 .github/workflows/differ.yml diff --git a/.github/workflows/differ.yml b/.github/workflows/differ.yml deleted file mode 100644 index a64378b..0000000 --- a/.github/workflows/differ.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Differ - -on: - workflow_run: - workflows: [Vib Build] - types: - - completed - -jobs: - differ: - runs-on: ubuntu-latest - container: - image: ghcr.io/vanilla-os/pico:main - - steps: - - uses: actions/checkout@v4 - - - name: Generate package diff - run: | - PACKAGE_LIST=$(.github/gen_package_list.sh) - apt install -f -y - apt install -y curl - IMAGE_DIGEST=$(curl -s -L -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/orgs/Vanilla-OS/packages/container/pico/versions | grep -m1 name | sed -E 's/^\s*"name": "(.+)".*$/\1/') - curl -X POST \ - -H 'Accept:application/json' \ - -H "Authorization:Basic $(echo -n "${{ secrets.DIFFER_USER }}:${{ secrets.DIFFER_PSW }}" | base64)" \ - -d "{\"digest\":\"${IMAGE_DIGEST}\",${PACKAGE_LIST}}" \ - ${{ vars.DIFFER_URL }}/images/pico/new diff --git a/.github/workflows/vib-build.yml b/.github/workflows/vib-build.yml index ff1bead..a7b068a 100644 --- a/.github/workflows/vib-build.yml +++ b/.github/workflows/vib-build.yml @@ -12,15 +12,14 @@ on: env: BUILDX_NO_DEFAULT_ATTESTATIONS: 1 -permissions: - contents: write # Allow actions to create release - packages: write # Allow pushing images to GHCR - attestations: write # To create and write attestations - id-token: write # Additional permissions for the persistence of the attestations - jobs: build: runs-on: ubuntu-latest + permissions: + contents: write # Allow actions to create release + packages: write # Allow pushing images to GHCR + attestations: write # To create and write attestations + id-token: write # Additional permissions for the persistence of the attestations steps: - uses: actions/checkout@v4 @@ -119,6 +118,7 @@ jobs: path: rootfs/vanilla-pico.tar.zst - uses: softprops/action-gh-release@v2 + if: ${{ github.event_name != 'pull_request' }} with: token: "${{ secrets.GITHUB_TOKEN }}" tag_name: "continuous" @@ -127,3 +127,28 @@ jobs: files: | rootfs/vanilla-pico.tar.gz rootfs/checksum.txt + + differ: + runs-on: ubuntu-latest + if: github.ref_type == 'tag' && github.repository == 'vanilla-os/pico-image' + needs: build + container: + image: ghcr.io/vanilla-os/pico:main + + steps: + - uses: actions/checkout@v4 + + - name: Generate package diff + run: | + PACKAGE_LIST=$(.github/gen_package_list.sh) + apt install -f -y + apt install -y curl + IMAGE_DIGEST=$(curl -s -L -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/orgs/Vanilla-OS/packages/container/pico/versions | grep -m1 name | sed -E 's/^\s*"name": "(.+)".*$/\1/') + curl -X POST \ + -H 'Accept:application/json' \ + -H "Authorization:Basic $(echo -n "${{ secrets.DIFFER_USER }}:${{ secrets.DIFFER_PSW }}" | base64)" \ + -d "{\"digest\":\"${IMAGE_DIGEST}\",${PACKAGE_LIST}}" \ + ${{ vars.DIFFER_URL }}/images/pico/new From 9676811095475c305061846af3b8a0de597dd465 Mon Sep 17 00:00:00 2001 From: Tau Date: Thu, 7 Nov 2024 00:32:43 +0100 Subject: [PATCH 09/11] fixes debootstrap failing --- .github/workflows/vib-build.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vib-build.yml b/.github/workflows/vib-build.yml index a7b068a..7a50f9f 100644 --- a/.github/workflows/vib-build.yml +++ b/.github/workflows/vib-build.yml @@ -24,11 +24,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install debootstrap from Ubuntu git + - name: Install debootstrap run: | - sudo git clone --depth 1 https://git.launchpad.net/ubuntu/+source/debootstrap /debootstrap - sudo chmod a+x /debootstrap/debootstrap - sudo ln -s /debootstrap/debootstrap -t /usr/local/bin + sudo apt-get update + sudo apt-get install -y debootstrap - name: Replace testing repository with production if: ${{ github.ref_type == 'tag' }} From 94c5f302213b3ea40a0a21cd7687df121c06c5aa Mon Sep 17 00:00:00 2001 From: Tau Date: Sun, 10 Nov 2024 19:23:03 +0000 Subject: [PATCH 10/11] removes replacing of repo in workflow This was confusing, as the repo in the code would not match the repo in the image. --- .github/workflows/vib-build.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/vib-build.yml b/.github/workflows/vib-build.yml index 7a50f9f..6eb9250 100644 --- a/.github/workflows/vib-build.yml +++ b/.github/workflows/vib-build.yml @@ -29,12 +29,6 @@ jobs: sudo apt-get update sudo apt-get install -y debootstrap - - name: Replace testing repository with production - if: ${{ github.ref_type == 'tag' }} - run: | - sed 's|http://testing.vanillaos.org|http://repo2.vanillaos.org|g' -i rootfs/build.sh - sed 's|http://testing.vanillaos.org|http://repo2.vanillaos.org|g' -i rootfs/includes.rootfs/etc/apt/sources.list.d/vanilla-base.sources - - name: Rootfs working-directory: rootfs run: | From dcc6d4720ba57d32767eba3b681dd15daf82166f Mon Sep 17 00:00:00 2001 From: Tau Date: Sun, 10 Nov 2024 19:24:54 +0000 Subject: [PATCH 11/11] uses new stable repo --- rootfs/build.sh | 2 +- .../includes.rootfs/etc/apt/sources.list.d/vanilla-base.sources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rootfs/build.sh b/rootfs/build.sh index 5b87a9c..4914412 100644 --- a/rootfs/build.sh +++ b/rootfs/build.sh @@ -4,7 +4,7 @@ set -e # Rootfs definitions ROOTFS_NAME="vanilla-pico" -REPO_URL=http://testing.vanillaos.org +REPO_URL=http://repo2.vanillaos.org REPO_KEY=vanilla.key CUSTOM_PACKAGE="" CLEANUP_DIRS="/usr/share/doc/* diff --git a/rootfs/includes.rootfs/etc/apt/sources.list.d/vanilla-base.sources b/rootfs/includes.rootfs/etc/apt/sources.list.d/vanilla-base.sources index 6529c19..ff57ac8 100644 --- a/rootfs/includes.rootfs/etc/apt/sources.list.d/vanilla-base.sources +++ b/rootfs/includes.rootfs/etc/apt/sources.list.d/vanilla-base.sources @@ -1,5 +1,5 @@ Types: deb -URIs: http://testing.vanillaos.org/ +URIs: http://repo2.vanillaos.org/ Suites: sid Architectures: amd64 Components: main contrib non-free non-free-firmware