Skip to content

Commit 1800297

Browse files
authored
Merge pull request #10 from repasscloud/dev
update gh-actions
2 parents 3cd5295 + 2bf7ddb commit 1800297

File tree

4 files changed

+175
-93
lines changed

4 files changed

+175
-93
lines changed

.github/workflows/build-linux-macos-matrix.yaml

Lines changed: 0 additions & 70 deletions
This file was deleted.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Build Linux/macOS/Windows Binaries
2+
3+
on:
4+
push:
5+
branches: [ dev ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-all:
10+
name: Build for ${{ matrix.runtime }}
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
runtime:
16+
- linux-x64
17+
- linux-musl-x64
18+
- linux-musl-arm64
19+
- linux-arm
20+
- linux-arm64
21+
- osx-x64
22+
- osx-arm64
23+
- win-x64
24+
- win-x86
25+
- win-arm64
26+
27+
steps:
28+
- name: Checkout source
29+
uses: actions/checkout@v4
30+
31+
- name: Setup .NET
32+
uses: actions/setup-dotnet@v4
33+
with:
34+
dotnet-version: '9.0.x'
35+
36+
- name: Restore dependencies
37+
run: dotnet restore
38+
39+
- name: Publish ${{ matrix.runtime }} Binary
40+
run: >
41+
dotnet publish ssh-c.csproj
42+
-c Release
43+
-r ${{ matrix.runtime }}
44+
--self-contained true
45+
-p:PublishSingleFile=true
46+
-p:PublishTrimmed=true
47+
-p:EnableCompressionInSingleFile=true
48+
-p:IncludeNativeLibrariesForSelfExtract=true
49+
-o publish/${{ matrix.runtime }}
50+
51+
- name: Rename published binary to ssh-c or ssh-c.exe
52+
run: |
53+
path=publish/${{ matrix.runtime }}
54+
if [ -f "$path/com.repasscloud.ssh-c" ]; then
55+
mv "$path/com.repasscloud.ssh-c" "$path/ssh-c"
56+
elif [ -f "$path/com.repasscloud.ssh-c.exe" ]; then
57+
mv "$path/com.repasscloud.ssh-c.exe" "$path/ssh-c.exe"
58+
else
59+
echo "❌ No output binary found to rename."
60+
exit 1
61+
fi
62+
63+
- name: Make binary executable (non-Windows only)
64+
run: |
65+
path=publish/${{ matrix.runtime }}
66+
if [ -f "$path/ssh-c" ]; then
67+
chmod +x "$path/ssh-c"
68+
fi
69+
70+
- name: Verify binary format
71+
run: |
72+
path=publish/${{ matrix.runtime }}
73+
if [ -f "$path/ssh-c" ]; then
74+
file "$path/ssh-c"
75+
elif [ -f "$path/ssh-c.exe" ]; then
76+
file "$path/ssh-c.exe"
77+
fi
78+
79+
- name: Generate SHA256 checksum
80+
run: |
81+
path=publish/${{ matrix.runtime }}
82+
if [ -f "$path/ssh-c" ]; then
83+
sha256sum "$path/ssh-c" > "$path/ssh-c_${{ matrix.runtime }}.sha256"
84+
elif [ -f "$path/ssh-c.exe" ]; then
85+
sha256sum "$path/ssh-c.exe" > "$path/ssh-c_${{ matrix.runtime }}.sha256"
86+
fi
87+
88+
- name: Zip binary and checksum
89+
run: |
90+
cd publish/${{ matrix.runtime }}
91+
if [ -f ssh-c ]; then
92+
zip ssh-c_${{ matrix.runtime }}.zip ssh-c ssh-c_${{ matrix.runtime }}.sha256
93+
elif [ -f ssh-c.exe ]; then
94+
zip ssh-c_${{ matrix.runtime }}.zip ssh-c.exe ssh-c_${{ matrix.runtime }}.sha256
95+
fi
96+
97+
- name: Upload Zipped Artifacts
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: ssh-c-${{ matrix.runtime }}-unsigned
101+
path: publish/${{ matrix.runtime }}/ssh-c_${{ matrix.runtime }}.zip

.github/workflows/build-release.yaml

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,18 @@ permissions:
99
contents: write
1010

1111
jobs:
12-
release-linux-windows:
13-
name: Build Release Assets (Linux + Windows)
12+
release-linux:
13+
name: Build Release Assets (Linux)
1414
runs-on: ubuntu-latest
1515

1616
strategy:
1717
matrix:
18-
runtime: [win-x64, linux-x64]
18+
runtime:
19+
- linux-x64
20+
- linux-musl-x64
21+
- linux-musl-arm64
22+
- linux-arm
23+
- linux-arm64
1924

2025
steps:
2126
- name: Checkout
@@ -54,13 +59,63 @@ jobs:
5459
publish/${{ matrix.runtime }}/ssh-c-${{ matrix.runtime }}.zip
5560
publish/${{ matrix.runtime }}/ssh-c-${{ matrix.runtime }}.sha256
5661
62+
release-windows:
63+
name: Build Release Assets (Windows)
64+
runs-on: windows-latest
65+
66+
strategy:
67+
matrix:
68+
runtime:
69+
- win-x64
70+
- win-x86
71+
- win-arm64
72+
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@v4
76+
77+
- name: Setup .NET
78+
uses: actions/setup-dotnet@v4
79+
with:
80+
dotnet-version: '9.0.x'
81+
82+
- name: Publish (${{ matrix.runtime }})
83+
run: |
84+
dotnet publish ssh-c.csproj \
85+
-c Release \
86+
-r ${{ matrix.runtime }} \
87+
--self-contained true \
88+
-p:PublishSingleFile=true \
89+
-p:PublishTrimmed=true \
90+
-p:EnableCompressionInSingleFile=true \
91+
-p:IncludeNativeLibrariesForSelfExtract=true \
92+
-o publish/${{ matrix.runtime }}
93+
94+
- name: Rename binary
95+
run: Rename-Item -Path publish/${{ matrix.runtime }}/com.repasscloud.ssh-c.exe -NewName ssh-c.exe
96+
97+
- name: Archive binary
98+
run: |
99+
cd publish/${{ matrix.runtime }}
100+
Compress-Archive -Path ssh-c.exe -DestinationPath ssh-c-${{ matrix.runtime }}.zip
101+
Get-FileHash -Algorithm SHA256 ssh-c-${{ matrix.runtime }}.zip | ForEach-Object { $_.Hash } > ssh-c-${{ matrix.runtime }}.sha256
102+
103+
- name: Upload Release Assets
104+
uses: softprops/action-gh-release@v2
105+
with:
106+
files: |
107+
publish/${{ matrix.runtime }}/ssh-c-${{ matrix.runtime }}.zip
108+
publish/${{ matrix.runtime }}/ssh-c-${{ matrix.runtime }}.sha256
109+
57110
release-macos:
58111
name: Build Release Assets (macOS)
59112
runs-on: macos-latest
60113

61114
strategy:
62115
matrix:
63-
runtime: [osx-x64, osx-arm64]
116+
runtime:
117+
- osx-x64
118+
- osx-arm64
64119

65120
steps:
66121
- name: Checkout

.github/workflows/signpath-windows-release.yaml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: SignPath Windows Release
22

33
on:
4-
push:
5-
branches: [ dev ]
64
workflow_dispatch:
75

86
jobs:
@@ -31,18 +29,21 @@ jobs:
3129

3230
- name: Publish Windows ${{ matrix.runtime }} EXE
3331
run: >
34-
dotnet publish ssh-c.csproj \
35-
-c Release \
36-
-r ${{ matrix.runtime }} \
37-
--self-contained true \
38-
-p:PublishSingleFile=true \
39-
-p:PublishTrimmed=true \
40-
-p:EnableCompressionInSingleFile=true \
41-
-p:IncludeNativeLibrariesForSelfExtract=true \
42-
-o publish/${{ matrix.runtime }}
32+
dotnet publish ssh-c.csproj
33+
-c Release
34+
-r ${{ matrix.runtime }}
35+
--self-contained true
36+
-p:PublishSingleFile=true
37+
-p:PublishTrimmed=true
38+
-p:EnableCompressionInSingleFile=true
39+
-p:IncludeNativeLibrariesForSelfExtract=true
40+
-o publish/${{ matrix.runtime }}
4341
44-
- name: Rename binary before signing
45-
run: mv publish/${{ matrix.runtime }}/com.repasscloud.ssh-c.exe publish/${{ matrix.runtime }}/ssh-c.exe
42+
- name: Rename binary
43+
run: >
44+
if [ -f publish/${{ matrix.runtime }}/com.repasscloud.ssh-c.exe ]; then
45+
mv publish/${{ matrix.runtime }}/com.repasscloud.ssh-c.exe publish/${{ matrix.runtime }}/ssh-c.exe
46+
fi
4647
4748
- name: Install SignPath PowerShell module
4849
shell: pwsh
@@ -59,14 +60,9 @@ jobs:
5960
-OrganizationId "7986306f-df77-4bb0-b011-dc2e6289232e" `
6061
-ProjectSlug "SSH-C" `
6162
-SigningPolicySlug "ssh-c_DEV_Release" `
62-
-OutputArtifactPath "publish/${{ matrix.runtime }}/ssh-c.signed.exe" `
63+
-OutputArtifactPath "publish/${{ matrix.runtime }}/ssh-c_${{ matrix.runtime }}.exe" `
6364
-WaitForCompletion
6465
65-
- name: Replace original EXE with signed version
66-
run: >
67-
rm publish/${{ matrix.runtime }}/ssh-c.exe && \
68-
mv publish/${{ matrix.runtime }}/ssh-c.signed.exe publish/${{ matrix.runtime }}/ssh-c_${{ matrix.runtime }}.exe
69-
7066
- name: Generate SHA256 checksum
7167
run: >
7268
sha256sum publish/${{ matrix.runtime }}/ssh-c_${{ matrix.runtime }}.exe > publish/${{ matrix.runtime }}/ssh-c_${{ matrix.runtime }}.exe.sha256

0 commit comments

Comments
 (0)