-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (83 loc) · 2.72 KB
/
build-release.yml
File metadata and controls
97 lines (83 loc) · 2.72 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
name: Build Release Executables
on:
release:
types: [published]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
name: windows-x64
exe: gitdock.exe
script: pwsh -File scripts/build-sea.ps1
- os: macos-latest
name: macos-x64
exe: gitdock
script: chmod +x scripts/build-sea.sh && ./scripts/build-sea.sh
- os: ubuntu-latest
name: linux-x64
exe: gitdock
script: chmod +x scripts/build-sea.sh && ./scripts/build-sea.sh
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install dependencies
run: npm install
- name: Build SEA executable
run: ${{ matrix.script }}
- name: Prepare release folder (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path release | Out-Null
Copy-Item "dist\${{ matrix.exe }}" release\
Copy-Item dashboard.html, workspace-setup.html, gitdock-logo.png, gitdock-logo-nobg.png, start.bat release\
- name: Prepare release folder (Unix)
if: matrix.os != 'windows-latest'
shell: bash
run: |
mkdir -p release
cp "dist/${{ matrix.exe }}" release/
cp dashboard.html workspace-setup.html gitdock-logo.png gitdock-logo-nobg.png release/
- name: Create zip (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
Compress-Archive -Path release\* -DestinationPath gitdock-${{ matrix.name }}.zip -Force
- name: Create zip (Unix)
if: matrix.os != 'windows-latest'
shell: bash
run: |
cd release && zip -r ../gitdock-${{ matrix.name }}.zip . && cd ..
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: gitdock-${{ matrix.name }}
path: gitdock-${{ matrix.name }}.zip
upload-release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Upload to Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
find artifacts -name "*.zip" -type f | while read f; do
echo "Uploading $f"
gh release upload "${{ github.event.release.tag_name }}" "$f" --clobber
done