-
Notifications
You must be signed in to change notification settings - Fork 3
144 lines (117 loc) · 4.08 KB
/
Copy pathrelease.yml
File metadata and controls
144 lines (117 loc) · 4.08 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
134
135
136
137
138
139
140
141
142
143
144
name: Release
on:
push:
tags:
- 'v*'
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
permissions:
contents: write
jobs:
build-macos-x64:
runs-on: macos-15-intel
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Verify Python architecture
run: |
echo "=== python ==="
which python || true
python -c "import platform; machine = platform.machine(); print(machine); assert machine == 'x86_64', f'Expected x86_64, got {machine}'"
echo "=== python3 ==="
which python3 || true
python3 -c "import platform; machine = platform.machine(); print(machine); assert machine == 'x86_64', f'Expected x86_64, got {machine}'"
- name: Build macOS x64 binary
run: python build_binaries.py darwin x86_64
- name: Inspect binary
run: |
file bin/darwin/docugenius-cli
lipo -archs bin/darwin/docugenius-cli | grep -x 'x86_64'
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: darwin-x64
path: bin/darwin/docugenius-cli
retention-days: 1
build-macos-arm64:
runs-on: macos-15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Verify Python architecture
run: |
which python3
python3 -c "import platform; machine = platform.machine(); print(machine); assert machine == 'arm64', f'Expected arm64, got {machine}'"
- name: Build macOS arm64 binary
run: python3 build_binaries.py darwin arm64
- name: Inspect binary
run: |
file bin/darwin/docugenius-cli
lipo -archs bin/darwin/docugenius-cli | grep -x 'arm64'
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: darwin-arm64
path: bin/darwin/docugenius-cli
retention-days: 1
package-and-release:
needs: [build-macos-x64, build-macos-arm64]
runs-on: macos-15
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Compile
run: npm run compile
- name: Download macOS x64 binary
uses: actions/download-artifact@v4
with:
name: darwin-x64
path: ${{ runner.temp }}/darwin-x64/
- name: Download macOS arm64 binary
uses: actions/download-artifact@v4
with:
name: darwin-arm64
path: ${{ runner.temp }}/darwin-arm64/
- name: Inspect downloaded artifacts
run: |
ls -la "${RUNNER_TEMP}/darwin-x64/"
ls -la "${RUNNER_TEMP}/darwin-arm64/"
file "${RUNNER_TEMP}/darwin-x64/docugenius-cli" || true
file "${RUNNER_TEMP}/darwin-arm64/docugenius-cli" || true
lipo -archs "${RUNNER_TEMP}/darwin-x64/docugenius-cli"
lipo -archs "${RUNNER_TEMP}/darwin-arm64/docugenius-cli"
- name: Create macOS universal binary
run: |
mkdir -p bin/darwin
lipo -create "${RUNNER_TEMP}/darwin-x64/docugenius-cli" "${RUNNER_TEMP}/darwin-arm64/docugenius-cli" -output bin/darwin/docugenius-cli
chmod +x bin/darwin/docugenius-cli
file bin/darwin/docugenius-cli
lipo -archs bin/darwin/docugenius-cli | grep -E '^(x86_64 arm64|arm64 x86_64)$'
rm -rf bin/darwin-x64 bin/darwin-arm64
- name: Verify Windows batch script exists
run: test -f bin/win32/docugenius-cli.bat
- name: Package extension
run: npx vsce package
- name: List artifacts
run: ls -la *.vsix
- name: Upload GitHub Release
uses: softprops/action-gh-release@v2
with:
files: '*.vsix'
generate_release_notes: true