fix: generation flipping #138
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: cmd | |
permissions: | |
contents: write | |
actions: read | |
id-token: write | |
defaults: | |
run: | |
shell: bash | |
on: | |
push: | |
branches: | |
- 'main' | |
- 'branch-v*.*' | |
paths-ignore: | |
- "docs/**" | |
- "**.md" | |
- "**.mdx" | |
- "**.png" | |
- "**.jpg" | |
- "!.github/workflows/ci.yml" | |
tags: | |
- "v*.*.*" | |
jobs: | |
build: | |
timeout-minutes: 15 | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
persist-credentials: false | |
- name: Setup Go | |
timeout-minutes: 15 | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22.9" | |
cache-dependency-path: | | |
cmd/**/go.sum | |
- name: Make | |
run: make build | |
env: | |
VERSION: "${{ github.ref_name }}" | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
include-hidden-files: true | |
path: ${{ github.workspace }}/.dist/* | |
- name: Release | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
fail_on_unmatched_files: true | |
tag_name: "${{ github.ref_name }}" | |
prerelease: ${{ contains(github.ref, 'rc') }} | |
files: ${{ github.workspace }}/.dist/* | |
publish: | |
needs: | |
- build | |
permissions: | |
contents: write | |
actions: read | |
id-token: write | |
timeout-minutes: 15 | |
runs-on: ubuntu-22.04 | |
env: | |
PACKAGE_REGISTRY: "gpustack" | |
PACKAGE_IMAGE: "gguf-parser" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
persist-credentials: false | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:qemu-v7.0.0 | |
platforms: "arm64" | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.CI_DOCKERHUB_USERNAME }} | |
password: ${{ secrets.CI_DOCKERHUB_PASSWORD }} | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
path: ${{ github.workspace }}/.dist | |
merge-multiple: true | |
- name: Get Metadata | |
id: metadata | |
uses: docker/metadata-action@v5 | |
with: | |
images: "${{ env.PACKAGE_REGISTRY }}/${{ env.PACKAGE_IMAGE }}" | |
- name: Package | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
file: ${{ github.workspace }}/Dockerfile | |
context: ${{ github.workspace }} | |
platforms: "linux/amd64,linux/arm64" | |
tags: ${{ steps.metadata.outputs.tags }} | |
labels: ${{ steps.metadata.outputs.labels }} | |
cache-from: | | |
type=registry,ref=${{ env.PACKAGE_REGISTRY }}/${{ env.PACKAGE_IMAGE }}:build-cache | |
cache-to: | | |
type=registry,mode=max,oci-mediatypes=false,compression=gzip,ref=${{ env.PACKAGE_REGISTRY }}/${{ env.PACKAGE_IMAGE }}:build-cache,ignore-error=true | |
provenance: true | |
sbom: true |