name: goreleaser on: push: tags: - 'v*' jobs: goreleaser: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v7 with: fetch-depth: 0 - name: Set up Go uses: actions/setup-go@v5 with: go-version-file: go.mod # The cutover. A tagged build reads the model gallery (localai) by default # until this step runs; from here the tagged build reads the model library # (official-models, gallery/models/index.yaml) and not the gallery. # .goreleaser.yaml passes the value to the binary with -ldflags. - name: Cut the default model source over to the library run: echo "LOCALAI_MODEL_SOURCE=library" >> "$GITHUB_ENV" # The same cutover for the backends: until this step runs, a tagged build # reads the backend gallery (localai-backends, backend/index.yaml, which # is generated from the backend library). From here it reads the backend # library (official-backends, gallery/backends/index.yaml). - name: Cut the default backend source over to the library run: echo "LOCALAI_BACKEND_SOURCE=library" >> "$GITHUB_ENV" - name: Run GoReleaser uses: goreleaser/goreleaser-action@v7 with: version: v2.11.0 args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} MACOS_SIGN_P12: ${{ secrets.MACOS_CERTIFICATE }} MACOS_SIGN_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PWD }} MACOS_NOTARY_KEY: ${{ secrets.MACOS_NOTARY_KEY }} MACOS_NOTARY_KEY_ID: ${{ secrets.MACOS_NOTARY_KEY_ID }} MACOS_NOTARY_ISSUER_ID: ${{ secrets.MACOS_NOTARY_ISSUER_ID }} launcher-build-darwin: runs-on: macos-latest steps: - name: Checkout uses: actions/checkout@v7 with: fetch-depth: 0 - name: Set up Go uses: actions/setup-go@v5 with: go-version-file: go.mod - name: Import signing certificate env: MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }} MACOS_CI_KEYCHAIN_PWD: ${{ secrets.MACOS_CI_KEYCHAIN_PWD }} run: bash contrib/macos/sign-and-notarize.sh import-cert - name: Build, sign and notarize the DMG env: MACOS_SIGN_IDENTITY: ${{ secrets.MACOS_SIGN_IDENTITY }} MACOS_NOTARY_KEY: ${{ secrets.MACOS_NOTARY_KEY }} MACOS_NOTARY_KEY_ID: ${{ secrets.MACOS_NOTARY_KEY_ID }} MACOS_NOTARY_ISSUER_ID: ${{ secrets.MACOS_NOTARY_ISSUER_ID }} run: make release-launcher-darwin - name: Upload DMG to Release uses: softprops/action-gh-release@v3 with: files: ./dist/LocalAI.dmg launcher-build-linux: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v7 with: fetch-depth: 0 - name: Configure apt mirror on runner uses: ./.github/actions/configure-apt-mirror - name: Set up Go uses: actions/setup-go@v5 with: go-version-file: go.mod - name: Build launcher for Linux run: | sudo apt-get update sudo apt-get install golang gcc libgl1-mesa-dev xorg-dev libxkbcommon-dev make build-launcher-linux - name: Upload Linux launcher artifacts uses: softprops/action-gh-release@v3 with: files: ./local-ai-launcher-linux.tar.xz launcher-appimage: needs: goreleaser permissions: contents: write uses: ./.github/workflows/launcher-appimage.yaml with: publish: true