mirror of
https://github.com/mudler/LocalAI.git
synced 2026-10-28 09:08:54 -04:00
Bumps [oras-project/setup-oras](https://github.com/oras-project/setup-oras) from 1 to 2. - [Release notes](https://github.com/oras-project/setup-oras/releases) - [Commits](https://github.com/oras-project/setup-oras/compare/v1...v2) --- updated-dependencies: - dependency-name: oras-project/setup-oras dependency-version: '2' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
79 lines
2.4 KiB
YAML
79 lines
2.4 KiB
YAML
name: Publish official OCI galleries
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
paths:
|
|
- 'gallery/**'
|
|
- 'backend/index.yaml'
|
|
- 'scripts/build/gallery/**'
|
|
- '.github/workflows/gallery_publish.yml'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: publish-official-galleries
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
publish:
|
|
if: github.repository == 'mudler/LocalAI' && github.ref == 'refs/heads/master'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
env:
|
|
COSIGN_EXPERIMENTAL: '1'
|
|
GALLERY_REPOSITORY: quay.io/go-skynet/local-ai-backends
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- source: gallery
|
|
tag: gallery-models
|
|
- source: backend
|
|
tag: gallery-backends
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
- name: Test and package gallery
|
|
env:
|
|
GALLERY_SOURCE: ${{ matrix.source }}
|
|
run: |
|
|
go test ./scripts/build/gallery -count=1
|
|
go run ./scripts/build/gallery . "$GALLERY_SOURCE" "$RUNNER_TEMP/gallery"
|
|
- uses: oras-project/setup-oras@v2
|
|
with:
|
|
version: '1.3.0'
|
|
- uses: sigstore/cosign-installer@v3
|
|
with:
|
|
cosign-release: 'v2.6.5'
|
|
- name: Login to Quay.io
|
|
uses: docker/login-action@v4
|
|
with:
|
|
registry: quay.io
|
|
username: ${{ secrets.LOCALAI_REGISTRY_USERNAME }}
|
|
password: ${{ secrets.LOCALAI_REGISTRY_PASSWORD }}
|
|
- name: Publish and sign gallery
|
|
shell: bash
|
|
env:
|
|
GALLERY_TAG: ${{ matrix.tag }}
|
|
run: |
|
|
set -euo pipefail
|
|
cd "$RUNNER_TEMP/gallery"
|
|
files=()
|
|
while IFS= read -r -d '' file; do
|
|
files+=("${file#./}:application/yaml")
|
|
done < <(find . -type f -print0 | sort -z)
|
|
# Publish an immutable revision, then expose latest only after signing.
|
|
ref="$GALLERY_REPOSITORY:$GALLERY_TAG-$GITHUB_SHA"
|
|
oras push --artifact-type application/vnd.localai.gallery.v1 \
|
|
--format json "$ref" "${files[@]}" > "$RUNNER_TEMP/push.json"
|
|
digest=$(jq -er '.digest' "$RUNNER_TEMP/push.json")
|
|
cosign sign --yes --new-bundle-format \
|
|
--registry-referrers-mode=oci-1-1 "$GALLERY_REPOSITORY@$digest"
|
|
oras tag "$GALLERY_REPOSITORY@$digest" "$GALLERY_TAG"
|