Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade main branch #54

Merged
merged 6 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions .github/workflows/differ.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ jobs:
with:
fetch-depth: 0

- uses: vanilla-os/vib-gh-action@v0.7.4
- name: Change tag in recipe.
run: |
sed 's/ghcr.io\/vanilla-os\/desktop:dev/ghcr.io\/vanilla-os\/desktop:main/' -i recipe.yml

- uses: vanilla-os/vib-gh-action@v0.8.1
with:
recipe: 'recipe.yml'
plugins: 'Vanilla-OS/vib-fsguard:v1.5.3'
Expand Down
50 changes: 46 additions & 4 deletions .github/workflows/vib-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Vib Build
on:
push:
branches:
- 'main'
- 'dev'
tags:
- '*'
workflow_dispatch:
Expand All @@ -18,14 +18,15 @@ jobs:

steps:
- name: Verify Base Image Integrity
if: ${{ github.ref_type == 'tag' }}
run:
gh attestation verify oci://ghcr.io/vanilla-os/desktop:main --owner Vanilla-OS
env:
GH_TOKEN: ${{ github.token }}

build:
runs-on: ubuntu-latest
needs: verify-image
needs: [verify-image]
permissions:
contents: write # Allow actions to create release
packages: write # Allow pushing images to GHCR
Expand All @@ -35,7 +36,12 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: vanilla-os/vib-gh-action@v0.7.4
- name: Change tag in recipe
if: ${{ github.ref_type == 'tag' }}
run: |
sed 's/ghcr.io\/vanilla-os\/desktop:dev/ghcr.io\/vanilla-os\/desktop:main/' -i recipe.yml

- uses: vanilla-os/vib-gh-action@v0.8.1
with:
recipe: 'recipe.yml'
plugins: 'Vanilla-OS/vib-fsguard:v1.5.3'
Expand All @@ -51,6 +57,16 @@ jobs:
echo "REPO_OWNER_LOWERCASE=$REPO_OWNER_LOWERCASE" >> "$GITHUB_ENV"
echo "IMAGE_URL=ghcr.io/$REPO_OWNER_LOWERCASE/nvidia" >> "$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
Expand All @@ -62,7 +78,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
Expand Down Expand Up @@ -97,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
2 changes: 1 addition & 1 deletion recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Vanilla Desktop Nvidia
id: nvidia
stages:
- id: build
base: ghcr.io/vanilla-os/desktop:main
base: ghcr.io/vanilla-os/desktop:dev
singlelayer: false
labels:
maintainer: Vanilla OS Contributors
Expand Down
Loading