diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a2f7405 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,137 @@ +name: Build and Release + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +permissions: + contents: write + +jobs: + build-windows: + name: Build Windows (amd64) + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.25' + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + + - name: Build + run: wails build -platform windows/amd64 -ldflags "-X main.version=${{ github.ref_name }}" + + - name: Package + run: | + cd build/bin + Compress-Archive -Path uzdb.exe -DestinationPath uzdb-${{ github.ref_name }}-windows-amd64.zip + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: uzdb-windows-amd64 + path: build/bin/uzdb-${{ github.ref_name }}-windows-amd64.zip + + build-macos: + name: Build macOS (arm64) + runs-on: macos-15 + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.25' + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + + - name: Build + run: wails build -platform darwin/arm64 -ldflags "-X main.version=${{ github.ref_name }}" + + - name: Package + run: | + cd build/bin + zip -r uzdb-${{ github.ref_name }}-darwin-arm64.zip uzdb.app + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: uzdb-macos-arm64 + path: build/bin/uzdb-${{ github.ref_name }}-darwin-arm64.zip + + build-linux: + name: Build Linux (amd64) + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.25' + + - name: Set up 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 \ + libayatana-appindicator3-dev + + - name: Install Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + + - name: Build + run: wails build -platform linux/amd64 -ldflags "-X main.version=${{ github.ref_name }}" + + - name: Package + run: | + cd build/bin + tar -czf uzdb-${{ github.ref_name }}-linux-amd64.tar.gz uzdb + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: uzdb-linux-amd64 + path: build/bin/uzdb-${{ github.ref_name }}-linux-amd64.tar.gz + + release: + name: Create GitHub Release + needs: [ build-windows, build-macos, build-linux ] + runs-on: ubuntu-latest + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: dist + merge-multiple: true + + - name: Create release + uses: softprops/action-gh-release@v2 + with: + name: uzdb ${{ github.ref_name }} + draft: false + prerelease: false + generate_release_notes: true + files: dist/*