From 547e6b36f50afb0991b08ccdb0a7298928ad7cef Mon Sep 17 00:00:00 2001 From: "K.B.Dharun Krishna" Date: Fri, 8 Nov 2024 00:11:18 +0530 Subject: [PATCH] fu/ci: convert differ to job under vib-build Signed-off-by: K.B.Dharun Krishna --- .github/workflows/differ.yml | 33 --------------------------------- .github/workflows/vib-build.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 33 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 d27819f..0000000 --- a/.github/workflows/differ.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Differ - -on: - workflow_run: - workflows: [Vib Build] - types: - - completed - -jobs: - differ: - runs-on: ubuntu-latest - container: - image: ghcr.io/vanilla-os/nvidia:main - if: github.repository == 'vanilla-os/nvidia-image' - - steps: - - uses: actions/checkout@v4 - - - name: Generate package diff - run: | - lpkg --unlock - PACKAGE_LIST=$(.github/gen_package_list.sh) - apt-get 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/nvidia/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/nvidia/new - lpkg --lock diff --git a/.github/workflows/vib-build.yml b/.github/workflows/vib-build.yml index cf385d7..6a7a151 100644 --- a/.github/workflows/vib-build.yml +++ b/.github/workflows/vib-build.yml @@ -113,3 +113,29 @@ jobs: subject-name: ${{ env.IMAGE_URL }} subject-digest: ${{ steps.push.outputs.digest }} push-to-registry: false + + differ: + runs-on: ubuntu-latest + container: + image: ghcr.io/vanilla-os/nvidia:main + if: github.repository == 'vanilla-os/nvidia-image' && github.ref_type == 'tag' + needs: build + + steps: + - uses: actions/checkout@v4 + + - name: Generate package diff + run: | + lpkg --unlock + PACKAGE_LIST=$(.github/gen_package_list.sh) + apt-get 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/nvidia/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/nvidia/new + lpkg --lock