forked from glebkudr/shotgun_code
-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (112 loc) · 4.52 KB
/
Copy pathbuild.yml
File metadata and controls
133 lines (112 loc) · 4.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Cross-platform Build + Release — Shotgun Code
on:
workflow_dispatch:
permissions:
contents: write
env:
NODE_OPTIONS: "--max-old-space-size=4096"
jobs:
# ───────────────────────── BUILD ─────────────────────────
build:
strategy:
fail-fast: false
matrix:
include:
# ─────────── Linux ───────────
- os: ubuntu-latest
platform: linux/amd64
build_name: shotgun-code-linux-amd64
output_path: build/bin/shotgun-code-linux-amd64
upload_path: build/bin/shotgun-code-linux-amd64
# ────────── Windows ──────────
- os: windows-latest
platform: windows/amd64
build_name: shotgun-code-windows-amd64.exe
output_path: build/bin/shotgun-code-windows-amd64.exe
upload_path: build/bin/shotgun-code-windows-amd64.exe
# ─────────── macOS ───────────
- os: macos-latest
platform: darwin/arm64
build_name: shotgun-code
output_path: build/bin/shotgun-code.app
upload_path: shotgun-code-darwin-arm64.zip
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
check-latest: true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
# FIX: Pin Wails to v2.10.2 to match your go.mod
- name: Install Wails CLI
run: go install github.com/wailsapp/wails/v2/cmd/wails@v2.10.2
# OPTIMIZATION: --no-install-recommends speeds up install
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libgtk-3-dev libwebkit2gtk-4.1-dev
# FIX: Added '-tags webkit2_41' specifically for Linux/Ubuntu 24.04
- name: Build Wails App
shell: bash
run: |
if [ "${{ runner.os }}" == "Linux" ]; then
echo "Building for Linux with WebKit 4.1..."
wails build -platform ${{ matrix.platform }} -o ${{ matrix.build_name }} -clean -tags webkit2_41
else
echo "Building for ${{ runner.os }}..."
wails build -platform ${{ matrix.platform }} -o ${{ matrix.build_name }} -clean
fi
# Fix for macOS "App is damaged" error
- name: Package macOS Application
if: runner.os == 'macOS'
run: |
cd build/bin
ditto -c -k --sequesterRsrc --keepParent shotgun-code.app ../../shotgun-code-darwin-arm64.zip
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: shotgun_code-${{ matrix.platform == 'darwin/arm64' && 'darwin-arm64' || (matrix.platform == 'windows/amd64' && 'windows-amd64' || 'linux-amd64') }}
path: ${{ matrix.upload_path }}
if-no-files-found: error
# ─────────────────────── RELEASE ────────────────────────
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: shotgun_code-*
path: release-assets
merge-multiple: true
- name: Prepare Release Info
id: prep
run: |
TAG="v$(date -u '+%Y.%m.%d')-${GITHUB_SHA::7}"
echo "tag_name=$TAG" >> $GITHUB_OUTPUT
echo "release_name=Shotgun Code $TAG" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.prep.outputs.tag_name }}
name: ${{ steps.prep.outputs.release_name }}
body: |
🔨 Automatic build from commit ${{ github.sha }}
**Assets:**
- **macOS (Apple Silicon):** Unzip and drag to Applications.
- **Windows:** Standalone .exe file.
- **Linux:** Binary file.
Created with GitHub Actions.
files: release-assets/*
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}