Skip to content

Commit

Permalink
fu/ci: convert differ to job under vib-build
Browse files Browse the repository at this point in the history
Signed-off-by: K.B.Dharun Krishna <[email protected]>
  • Loading branch information
kbdharun committed Nov 7, 2024
1 parent 1ff65e3 commit a58469b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 33 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/differ.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/vib-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/vm:main
if: github.repository == 'vanilla-os/vm-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/vm/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/vm/new
lpkg --lock

0 comments on commit a58469b

Please sign in to comment.