260 lines
7.2 KiB
YAML
260 lines
7.2 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build-windows:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24'
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install Wails CLI
|
|
run: go install github.com/wailsapp/wails/v3/cmd/wails3@latest
|
|
|
|
- name: Install frontend dependencies
|
|
run: npm install
|
|
working-directory: frontend
|
|
|
|
- name: Build frontend
|
|
run: npm run generate
|
|
working-directory: frontend
|
|
|
|
- name: Generate bindings
|
|
run: wails3 generate bindings
|
|
|
|
- name: Generate syso
|
|
working-directory: build
|
|
run: wails3 generate syso -arch amd64 -icon windows/icon.ico -manifest windows/wails.exe.manifest -info windows/info.json -out ../wails_windows_amd64.syso
|
|
|
|
- name: Build
|
|
env:
|
|
CGO_ENABLED: 1
|
|
GOOS: windows
|
|
GOARCH: amd64
|
|
run: go build -tags production -trimpath -buildvcs=false -ldflags="-w -s -H windowsgui" -o bin/gitpilot.exe
|
|
|
|
- name: Copy config.yaml
|
|
run: Copy-Item config.yaml -Destination bin/config.yaml
|
|
|
|
- name: Remove syso
|
|
run: Remove-Item *.syso
|
|
|
|
- name: Package
|
|
run: Compress-Archive -Path "bin/gitpilot.exe","bin/config.yaml" -DestinationPath "bin/gitpilot-windows-amd64.zip" -Force
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: gitpilot-windows-amd64
|
|
path: bin/gitpilot-windows-amd64.zip
|
|
|
|
build-macos-arm64:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24'
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install Wails CLI
|
|
run: go install github.com/wailsapp/wails/v3/cmd/wails3@latest
|
|
|
|
- name: Install frontend dependencies
|
|
run: npm install
|
|
working-directory: frontend
|
|
|
|
- name: Build frontend
|
|
run: npm run generate
|
|
working-directory: frontend
|
|
|
|
- name: Generate bindings
|
|
run: wails3 generate bindings
|
|
|
|
- name: Build
|
|
env:
|
|
CGO_ENABLED: 1
|
|
GOOS: darwin
|
|
GOARCH: arm64
|
|
CGO_CFLAGS: "-mmacosx-version-min=10.15"
|
|
CGO_LDFLAGS: "-mmacosx-version-min=10.15"
|
|
MACOSX_DEPLOYMENT_TARGET: "10.15"
|
|
run: go build -tags "production,disable_onnx" -trimpath -buildvcs=false -ldflags="-w -s" -o bin/gitpilot
|
|
|
|
- name: Create .app bundle
|
|
run: |
|
|
mkdir -p bin/gitpilot.app/Contents/{MacOS,Resources}
|
|
cp build/darwin/icons.icns bin/gitpilot.app/Contents/Resources/
|
|
cp bin/gitpilot bin/gitpilot.app/Contents/MacOS/
|
|
cp config.yaml bin/gitpilot.app/Contents/MacOS/config.yaml
|
|
cp build/darwin/Info.plist bin/gitpilot.app/Contents/
|
|
codesign --force --deep --sign - bin/gitpilot.app
|
|
|
|
- name: Package
|
|
run: |
|
|
cd bin
|
|
zip -r gitpilot-macos-arm64.zip gitpilot.app
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: gitpilot-macos-arm64
|
|
path: bin/gitpilot-macos-arm64.zip
|
|
|
|
build-macos-amd64:
|
|
runs-on: macos-13
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24'
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install Wails CLI
|
|
run: go install github.com/wailsapp/wails/v3/cmd/wails3@latest
|
|
|
|
- name: Install frontend dependencies
|
|
run: npm install
|
|
working-directory: frontend
|
|
|
|
- name: Build frontend
|
|
run: npm run generate
|
|
working-directory: frontend
|
|
|
|
- name: Generate bindings
|
|
run: wails3 generate bindings
|
|
|
|
- name: Build
|
|
env:
|
|
CGO_ENABLED: 1
|
|
GOOS: darwin
|
|
GOARCH: amd64
|
|
CGO_CFLAGS: "-mmacosx-version-min=10.15"
|
|
CGO_LDFLAGS: "-mmacosx-version-min=10.15"
|
|
MACOSX_DEPLOYMENT_TARGET: "10.15"
|
|
run: go build -tags "production,disable_onnx" -trimpath -buildvcs=false -ldflags="-w -s" -o bin/gitpilot
|
|
|
|
- name: Create .app bundle
|
|
run: |
|
|
mkdir -p bin/gitpilot.app/Contents/{MacOS,Resources}
|
|
cp build/darwin/icons.icns bin/gitpilot.app/Contents/Resources/
|
|
cp bin/gitpilot bin/gitpilot.app/Contents/MacOS/
|
|
cp config.yaml bin/gitpilot.app/Contents/MacOS/config.yaml
|
|
cp build/darwin/Info.plist bin/gitpilot.app/Contents/
|
|
codesign --force --deep --sign - bin/gitpilot.app
|
|
|
|
- name: Package
|
|
run: |
|
|
cd bin
|
|
zip -r gitpilot-macos-amd64.zip gitpilot.app
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: gitpilot-macos-amd64
|
|
path: bin/gitpilot-macos-amd64.zip
|
|
|
|
build-linux:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24'
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev
|
|
|
|
- name: Install Wails CLI
|
|
run: go install github.com/wailsapp/wails/v3/cmd/wails3@latest
|
|
|
|
- name: Install frontend dependencies
|
|
run: npm install
|
|
working-directory: frontend
|
|
|
|
- name: Build frontend
|
|
run: npm run generate
|
|
working-directory: frontend
|
|
|
|
- name: Generate bindings
|
|
run: wails3 generate bindings
|
|
|
|
- name: Build
|
|
env:
|
|
CGO_ENABLED: 1
|
|
GOOS: linux
|
|
GOARCH: amd64
|
|
run: go build -tags "production,disable_onnx" -trimpath -buildvcs=false -ldflags="-w -s" -o bin/gitpilot
|
|
|
|
- name: Copy config.yaml
|
|
run: cp config.yaml bin/config.yaml
|
|
|
|
- name: Package
|
|
run: |
|
|
cd bin
|
|
tar czf gitpilot-linux-amd64.tar.gz gitpilot config.yaml
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: gitpilot-linux-amd64
|
|
path: bin/gitpilot-linux-amd64.tar.gz
|
|
|
|
release:
|
|
needs: [build-windows, build-macos-arm64, build-macos-amd64, build-linux]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
generate_release_notes: true
|
|
files: |
|
|
artifacts/gitpilot-windows-amd64/gitpilot-windows-amd64.zip
|
|
artifacts/gitpilot-macos-amd64/gitpilot-macos-amd64.zip
|
|
artifacts/gitpilot-macos-arm64/gitpilot-macos-arm64.zip
|
|
artifacts/gitpilot-linux-amd64/gitpilot-linux-amd64.tar.gz
|