Felipe97/llama-cpp-compiled
01.2k
1name: Make Release2 3on:4 workflow_dispatch:5 inputs:6 commit:7 description: 'Commit SHA to release (empty = branch HEAD)'8 required: false9 default: ''10 type: string11 dry_run:12 description: 'Dry run - validate without creating the tag'13 required: true14 type: boolean15 default: true16 skip_apiabi_check:17 description: 'Skip API/ABI compatibility check'18 required: false19 type: boolean20 default: false21 apiabi_compare_tag:22 description: 'Tag to compare against for API/ABI check (default: latest release)'23 required: false24 type: string25 default: ''26 27env:28 GH_TOKEN: ${{ github.token }}29 30permissions:31 contents: write32 packages: write33 34jobs:35 make-release:36 runs-on: ubuntu-24.04 # previously ubuntu-latest37 38 steps:39 - name: Checkout40 uses: actions/checkout@v641 with:42 ssh-key: ${{ secrets.DEPLOY_KEY_RELEASE }}43 ref: ${{ inputs.commit != '' && inputs.commit || github.ref_name }}44 fetch-depth: 045 46 - name: Install API/ABI check tools47 if: ${{ github.event.inputs.skip_apiabi_check != 'true' }}48 run: sudo apt-get install -y abi-compliance-checker abigail-tools49 50 - name: Run release checks51 id: checks52 run: bash scripts/make-release-checks.sh ${{ github.event.inputs.dry_run == 'true' && '--dry-run' || '' }}53 env:54 GITHUB_REPOSITORY: ${{ github.repository }}55 RELEASE_BRANCH: ${{ github.ref_name }}56 SKIP_APIABI_CHECK: ${{ github.event.inputs.skip_apiabi_check }}57 APIABI_COMPARE_TAG: ${{ github.event.inputs.apiabi_compare_tag }}58 59 - name: Create release tag60 if: ${{ github.event.inputs.dry_run == 'false' }}61 run: |62 VERSION="${{ steps.checks.outputs.version }}"63 git config user.name "github-actions[bot]"64 git config user.email "github-actions[bot]@users.noreply.github.com"65 git tag -a "${VERSION}" -m "Release ${VERSION}"66 git push origin "${VERSION}"67 echo "Created and pushed tag ${VERSION}"68 69 - name: Generate release description70 id: desc71 run: bash scripts/make-release-desc.sh "${{ steps.checks.outputs.version }}"72 env:73 GITHUB_REPOSITORY: ${{ github.repository }}74 75 - name: Create nightly-tag.txt76 id: nightly_tag_file77 run: |78 NIGHTLY_TAG="${{ steps.desc.outputs.nightly_tag }}"79 if [[ -z "${NIGHTLY_TAG}" ]]; then80 echo "Warning: no nightly tag found for the release commit - nightly-tag.txt will not be created"81 echo "create=false" >> "$GITHUB_OUTPUT"82 exit 083 fi84 echo "${NIGHTLY_TAG}" > nightly-tag.txt85 echo "create=true" >> "$GITHUB_OUTPUT"86 echo "nightly-tag.txt:"87 cat nightly-tag.txt88 89 - name: Create release90 id: create_release91 if: ${{ github.event.inputs.dry_run == 'false' }}92 uses: ggml-org/action-create-release@v193 env:94 GITHUB_TOKEN: ${{ github.token }}95 with:96 tag_name: ${{ steps.checks.outputs.version }}97 prerelease: false98 # TODO: enrich the body of the release with more information99 body: |100 ## Overview101 102 New version has been released.103 104 ## Assets105 106 ${{ steps.desc.outputs.nightly }}107 108 ## More info109 110 - [Releases and versioning of `ggml-org` projects](https://github.com/ggml-org/ggml/discussions/1579)111 112 ## ${{ steps.desc.outputs.changelog_title }}113 114 ${{ steps.desc.outputs.changelog }}115 116 - name: Upload nightly-tag.txt117 if: ${{ github.event.inputs.dry_run == 'false' && steps.nightly_tag_file.outputs.create == 'true' }}118 uses: actions/github-script@v8119 with:120 github-token: ${{secrets.GITHUB_TOKEN}}121 script: |122 const fs = require('fs');123 const release_id = '${{ steps.create_release.outputs.id }}';124 console.log('uploadReleaseAsset', 'nightly-tag.txt');125 await github.rest.repos.uploadReleaseAsset({126 owner: context.repo.owner,127 repo: context.repo.repo,128 release_id: release_id,129 name: 'nightly-tag.txt',130 data: await fs.readFileSync('./nightly-tag.txt')131 });132 133 - name: Re-tag container images with release version134 if: ${{ github.event.inputs.dry_run == 'false' && steps.desc.outputs.nightly_tag != '' }}135 env:136 GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}137 run: |138 VERSION="${{ steps.checks.outputs.version }}"139 NIGHTLY_TAG="${{ steps.desc.outputs.nightly_tag }}"140 REPO_OWNER="${GITHUB_REPOSITORY_OWNER,,}"141 IMAGE_REPO="ghcr.io/${REPO_OWNER}/${{ github.event.repository.name }}"142 143 echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin144 145 VARIANTS=("" "-cuda" "-cuda13" "-vulkan" "-rocm" "-intel" "-musa" "-openvino")146 TYPES=("full" "light" "server")147 for type in "${TYPES[@]}"; do148 for variant in "${VARIANTS[@]}"; do149 src="${IMAGE_REPO}:${type}${variant}-${NIGHTLY_TAG}"150 dst="${IMAGE_REPO}:${type}${variant}-${VERSION}"151 echo "Tagging ${src} -> ${dst}"152 docker buildx imagetools create --tag "${dst}" "${src}"153 done154 done155 156 - name: Dry run summary157 if: ${{ github.event.inputs.dry_run == 'true' }}158 run: |159 if [[ "${{ steps.checks.outputs.checks_passed }}" == "true" ]]; then160 echo "Dry run complete - all checks passed."161 echo "Would have created tag: ${{ steps.checks.outputs.version }}"162 if [[ -n "${{ steps.desc.outputs.nightly_tag }}" ]]; then163 echo "Would have uploaded nightly-tag.txt: ${{ steps.desc.outputs.nightly_tag }}"164 fi165 else166 echo "::error::Dry run found release check failures. A release tag would not be created."167 exit 1168 fi169 