HH-686: associate OCI package with repository #2

Merged
rogee merged 3 commits from agent/hh-686-gitea-package-association into main 2026-08-26 18:55:32 +08:00
5 changed files with 15 additions and 1 deletions
Showing only changes of commit c317d7af58 - Show all commits
+2
View File
@@ -24,5 +24,7 @@ jobs:
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.ipao.vip --username "${{ gitea.actor }}" --password-stdin
- name: Build image
env:
OCI_REVISION: ${{ gitea.sha }}
OCI_SOURCE: https://git.ipao.vip/rogee/fingerprint-chromium
PUSH: ${{ gitea.event_name != 'pull_request' }}
run: ./scripts/build.sh git.ipao.vip/rogee/fingerprint-chromium
+2
View File
@@ -24,5 +24,7 @@ jobs:
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io --username "${{ github.actor }}" --password-stdin
- name: Build image
env:
OCI_REVISION: ${{ github.sha }}
OCI_SOURCE: https://github.com/rogeecn/fingerprint-chromium
PUSH: ${{ github.event_name != 'pull_request' }}
run: ./scripts/build.sh ghcr.io/rogeecn/fingerprint-chromium
+4 -1
View File
@@ -15,8 +15,11 @@ RUN apt-get update \
FROM ubuntu:24.04
ARG CHROME_VERSION
ARG OCI_REVISION
ARG OCI_SOURCE
LABEL org.opencontainers.image.source="https://github.com/adryfish/fingerprint-chromium" \
LABEL org.opencontainers.image.revision="$OCI_REVISION" \
org.opencontainers.image.source="$OCI_SOURCE" \
org.opencontainers.image.version="$CHROME_VERSION"
RUN apt-get update \
+4
View File
@@ -3,6 +3,8 @@ set -euo pipefail
image="${1:-fingerprint-chromium}"
release_api="https://api.github.com/repos/adryfish/fingerprint-chromium/releases"
oci_revision="${OCI_REVISION:-$(git rev-parse HEAD)}"
oci_source="${OCI_SOURCE:-https://git.ipao.vip/rogee/fingerprint-chromium}"
if [[ -n "${CHROME_VERSION:-}" ]]; then
release_url="$release_api/tags/$CHROME_VERSION"
@@ -21,6 +23,8 @@ tag="$image:$version"
docker build --pull --platform linux/amd64 \
--build-arg "CHROME_VERSION=$version" \
--build-arg "CHROME_URL=$asset_url" \
--build-arg "OCI_REVISION=$oci_revision" \
--build-arg "OCI_SOURCE=$oci_source" \
--tag "$tag" .
if [[ "${PUSH:-false}" == "true" ]]; then
+3
View File
@@ -12,3 +12,6 @@ grep -q 'git.ipao.vip/rogee/fingerprint-chromium' .gitea/workflows/publish.yml
grep -q 'ghcr.io/rogeecn/fingerprint-chromium' .github/workflows/publish.yml
grep -q 'packages: write' .gitea/workflows/publish.yml
grep -q 'packages: write' .github/workflows/publish.yml
grep -q 'org.opencontainers.image.revision="$OCI_REVISION"' Dockerfile
grep -q 'org.opencontainers.image.source="$OCI_SOURCE"' Dockerfile
grep -q 'OCI_SOURCE: https://git.ipao.vip/rogee/fingerprint-chromium' .gitea/workflows/publish.yml