Spaces:
Paused
Paused
Download .github/workflows/release.yml from stremio-db/a: direct link, hf CLI and curl.
- Browser
- Download file 4.69 kB
-
https://huggingface.co/spaces/stremio-db/a/resolve/main/.github/workflows/release.yml
- Command line
-
hf download hf://spaces/stremio-db/a/.github/workflows/release.yml
-
curl -L -o release.yml https://huggingface.co/spaces/stremio-db/a/resolve/main/.github/workflows/release.yml
4.69 kB
| name: Release | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build: | |
| name: Build (${{ matrix.platform }}) | |
| runs-on: ${{ matrix.runner }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| matrix: | |
| include: | |
| - platform: linux/amd64 | |
| runner: ubuntu-latest | |
| - platform: linux/arm64 | |
| runner: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| run: | | |
| echo "image_name=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" | |
| echo "platform_pair=$(echo '${{ matrix.platform }}' | tr '/' '-')" >> "$GITHUB_OUTPUT" | |
| - uses: docker/build-push-action@v6 | |
| id: build | |
| with: | |
| context: . | |
| file: Containerfile | |
| platforms: ${{ matrix.platform }} | |
| # Disable BuildKit's automatic attestation manifests. These embed an | |
| # extra image-index entry per platform that registries (e.g. GHCR) | |
| # surface as bogus `unknown/unknown` architectures. | |
| provenance: false | |
| sbom: false | |
| outputs: type=image,"name=ghcr.io/${{ steps.meta.outputs.image_name }},${{ secrets.DOCKERHUB_USERNAME }}/openposterdb",push-by-digest=true,name-canonical=true,push=true | |
| cache-from: type=registry,ref=ghcr.io/${{ steps.meta.outputs.image_name }}-buildcache:${{ steps.meta.outputs.platform_pair }} | |
| cache-to: type=registry,ref=ghcr.io/${{ steps.meta.outputs.image_name }}-buildcache:${{ steps.meta.outputs.platform_pair }},compression=zstd,mode=max | |
| - name: Export digest | |
| run: | | |
| mkdir -p ${{ runner.temp }}/digests | |
| echo "${{ steps.build.outputs.digest }}" > "${{ runner.temp }}/digests/${{ steps.meta.outputs.platform_pair }}" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: digest-${{ steps.meta.outputs.platform_pair }} | |
| path: ${{ runner.temp }}/digests/* | |
| retention-days: 1 | |
| merge: | |
| name: Create multi-arch manifests | |
| runs-on: ubuntu-latest | |
| needs: build | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: digest-* | |
| merge-multiple: true | |
| path: ${{ runner.temp }}/digests | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| run: | | |
| TAG="${{ github.event.release.tag_name }}" | |
| VERSION="${TAG#v}" | |
| MAJOR="v${VERSION%%.*}" | |
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "major=$MAJOR" >> "$GITHUB_OUTPUT" | |
| echo "image_name=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" | |
| - name: Create and push GHCR manifest | |
| working-directory: ${{ runner.temp }}/digests | |
| run: | | |
| GHCR_IMAGE="ghcr.io/${{ steps.meta.outputs.image_name }}" | |
| docker buildx imagetools create \ | |
| -t "$GHCR_IMAGE:${{ steps.meta.outputs.tag }}" \ | |
| -t "$GHCR_IMAGE:${{ steps.meta.outputs.version }}" \ | |
| -t "$GHCR_IMAGE:${{ steps.meta.outputs.major }}" \ | |
| -t "$GHCR_IMAGE:latest" \ | |
| $(for f in *; do echo "$GHCR_IMAGE@$(cat "$f")"; done) | |
| - name: Create and push Docker Hub manifest | |
| working-directory: ${{ runner.temp }}/digests | |
| run: | | |
| DH_IMAGE="${{ secrets.DOCKERHUB_USERNAME }}/openposterdb" | |
| docker buildx imagetools create \ | |
| -t "$DH_IMAGE:${{ steps.meta.outputs.tag }}" \ | |
| -t "$DH_IMAGE:${{ steps.meta.outputs.version }}" \ | |
| -t "$DH_IMAGE:${{ steps.meta.outputs.major }}" \ | |
| -t "$DH_IMAGE:latest" \ | |
| $(for f in *; do echo "$DH_IMAGE@$(cat "$f")"; done) | |