chore: release v0.12.1 #48
Workflow file for this run
This file contains hidden or 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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| archive: tar.gz | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| archive: tar.gz | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| archive: tar.gz | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| archive: tar.gz | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| archive: zip | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: ${{ matrix.target }} | |
| - name: Install cross-compilation tools | |
| if: matrix.target == 'aarch64-unknown-linux-gnu' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-aarch64-linux-gnu | |
| - name: Build | |
| run: cargo build --release --target ${{ matrix.target }} | |
| env: | |
| CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc | |
| - name: Package (Unix) | |
| if: matrix.os != 'windows-latest' | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| tar czf ../../../models-${{ matrix.target }}.tar.gz models | |
| cd ../../.. | |
| - name: Package (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| 7z a ../../../models-${{ matrix.target }}.zip models.exe | |
| cd ../../.. | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: models-${{ matrix.target }} | |
| path: models-${{ matrix.target }}.${{ matrix.archive }} | |
| package-linux: | |
| name: Package Linux (${{ matrix.arch }}) | |
| needs: build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: x86_64 | |
| target: x86_64-unknown-linux-gnu | |
| - arch: aarch64 | |
| target: aarch64-unknown-linux-gnu | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install packaging tools | |
| run: | | |
| curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash | |
| cargo binstall -y --version 3.6.3 cargo-deb | |
| cargo binstall -y --version 0.20.0 cargo-generate-rpm | |
| - name: Download compiled binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: models-${{ matrix.target }} | |
| path: artifacts | |
| - name: Place binary for packagers | |
| run: | | |
| mkdir -p target/${{ matrix.target }}/release | |
| tar xzf artifacts/models-${{ matrix.target }}.tar.gz -C target/${{ matrix.target }}/release/ | |
| - name: Build .deb | |
| run: cargo deb --no-build --no-strip --target ${{ matrix.target }} | |
| - name: Build .rpm | |
| run: cargo generate-rpm --target ${{ matrix.target }} | |
| - name: Upload .deb | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: models-deb-${{ matrix.arch }} | |
| path: target/${{ matrix.target }}/debian/*.deb | |
| - name: Upload .rpm | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: models-rpm-${{ matrix.arch }} | |
| path: target/${{ matrix.target }}/generate-rpm/*.rpm | |
| release: | |
| name: Create Release | |
| needs: [build, package-linux] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Generate checksums | |
| run: | | |
| cd artifacts | |
| find . -type f \( -name '*.tar.gz' -o -name '*.zip' -o -name '*.deb' -o -name '*.rpm' \) -exec sha256sum {} \; | sed 's| \./[^/]*/| |' > ../SHA256SUMS | |
| cd .. | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| artifacts/**/* | |
| SHA256SUMS | |
| generate_release_notes: true | |
| prerelease: ${{ contains(github.ref_name, '-') }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| publish-crate: | |
| name: Publish to crates.io | |
| needs: build | |
| if: "!contains(github.ref_name, '-')" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Publish | |
| run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --allow-dirty | |
| update-aur: | |
| name: Update AUR Package | |
| needs: release | |
| if: "!contains(github.ref_name, '-')" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Calculate SHA256 hashes | |
| id: hashes | |
| run: | | |
| echo "readme=$(sha256sum README.md | cut -d ' ' -f1)" >> $GITHUB_OUTPUT | |
| echo "license=$(sha256sum LICENSE | cut -d ' ' -f1)" >> $GITHUB_OUTPUT | |
| echo "x86_64=$(sha256sum artifacts/models-x86_64-unknown-linux-gnu/models-x86_64-unknown-linux-gnu.tar.gz | cut -d ' ' -f1)" >> $GITHUB_OUTPUT | |
| echo "aarch64=$(sha256sum artifacts/models-aarch64-unknown-linux-gnu/models-aarch64-unknown-linux-gnu.tar.gz | cut -d ' ' -f1)" >> $GITHUB_OUTPUT | |
| - name: Generate PKGBUILD | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| mkdir -p aur | |
| cat > aur/PKGBUILD << 'PKGEOF' | |
| # Maintainer: arimxyer <https://github.com/arimxyer> | |
| # Maintainer: Rafael Dominiquini <rafaeldominiquini at gmail dot com> | |
| _pkgauthor=reyamira | |
| _pkgname=models | |
| _appname=${_pkgname} | |
| pkgname=${_pkgname}-bin | |
| pkgdesc="A fast TUI and CLI for browsing AI models, benchmarks, and coding agents" | |
| pkgver=VERSION_PLACEHOLDER | |
| pkgrel=1 | |
| _pkgvername=v${pkgver} | |
| arch=('x86_64' 'aarch64') | |
| _barch=('x86_64-unknown-linux-gnu' 'aarch64-unknown-linux-gnu') | |
| url="https://github.com/${_pkgauthor}/${_pkgname}" | |
| _urlraw="https://raw.githubusercontent.com/${_pkgauthor}/${_pkgname}/${_pkgvername}" | |
| license=('MIT') | |
| provides=("${_pkgname}") | |
| conflicts=("${_pkgname}") | |
| depends=('libgcc' 'glibc') | |
| source=("README-${pkgver}.md::${_urlraw}/README.md" | |
| "LICENSE-${pkgver}::${_urlraw}/LICENSE") | |
| source_x86_64=("${_pkgname}-${arch[0]}-${pkgver}.tgz::${url}/releases/download/${_pkgvername}/${_appname}-${_barch[0]}.tar.gz") | |
| source_aarch64=("${_pkgname}-${arch[1]}-${pkgver}.tgz::${url}/releases/download/${_pkgvername}/${_appname}-${_barch[1]}.tar.gz") | |
| sha256sums=('HASH_README' | |
| 'HASH_LICENSE') | |
| sha256sums_x86_64=('HASH_X86_64') | |
| sha256sums_aarch64=('HASH_AARCH64') | |
| package() { | |
| cd "${srcdir}/" || exit | |
| install -Dm755 "${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}" | |
| install -Dm644 "README-${pkgver}.md" "${pkgdir}/usr/share/doc/${pkgname}/README.md" | |
| install -Dm644 "LICENSE-${pkgver}" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" | |
| } | |
| PKGEOF | |
| sed -i 's/^ //' aur/PKGBUILD | |
| sed -i "s/VERSION_PLACEHOLDER/${VERSION}/g" aur/PKGBUILD | |
| sed -i "s/HASH_README/${{ steps.hashes.outputs.readme }}/g" aur/PKGBUILD | |
| sed -i "s/HASH_LICENSE/${{ steps.hashes.outputs.license }}/g" aur/PKGBUILD | |
| sed -i "s/HASH_X86_64/${{ steps.hashes.outputs.x86_64 }}/g" aur/PKGBUILD | |
| sed -i "s/HASH_AARCH64/${{ steps.hashes.outputs.aarch64 }}/g" aur/PKGBUILD | |
| - name: Publish to AUR | |
| uses: KSXGitHub/github-actions-deploy-aur@v4.1.3 | |
| with: | |
| pkgname: models-bin | |
| pkgbuild: aur/PKGBUILD | |
| commit_username: arimxyer | |
| commit_email: arimxyer@users.noreply.github.com | |
| ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
| commit_message: "Update to ${{ github.ref_name }}" |