4
4
push :
5
5
tags : ' v*'
6
6
7
+ permissions :
8
+ id-token : write
9
+ contents : write
10
+
7
11
env :
8
12
GO_VERSION : 1.23.3
9
13
@@ -24,26 +28,20 @@ jobs:
24
28
25
29
- name : Build
26
30
run : |
27
- sudo apt-get update -q -y
28
- sudo apt-get install -q -y osslsigncode
29
31
go install github.com/tc-hib/go-winres@latest
30
32
31
33
VERSION=${GITHUB_REF/refs\/tags\//}
32
34
GIT_COMMIT=`git describe --always --dirty`
33
35
FILE_VERSION=${VERSION:1}.0
34
36
35
37
mkdir bin
38
+ mkdir win
36
39
go-winres simply --arch amd64 --product-version $VERSION-$GIT_COMMIT --file-version $FILE_VERSION --file-description "SFTPGo plugin pubsub" --product-name "SFTPGo plugin pubsub" --copyright "AGPL-3.0" --original-filename sftpgo-plugin-pubsub-windows-x86_64.exe --icon res/icon.ico
37
- CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags "-s -w -X main.commitHash=`git describe --always --dirty` -X main.date=`date -u +%FT%TZ`" -o sftpgo-plugin-pubsub-windows-x86_64.exe
40
+ CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags "-s -w -X main.commitHash=`git describe --always --dirty` -X main.date=`date -u +%FT%TZ`" -o win/ sftpgo-plugin-pubsub-windows-x86_64.exe
38
41
go-winres simply --arch arm64 --product-version $VERSION-$GIT_COMMIT --file-version $FILE_VERSION --file-description "SFTPGo plugin pubsub" --product-name "SFTPGo plugin pubsub" --copyright "AGPL-3.0" --original-filename sftpgo-plugin-pubsub-windows-arm64.exe --icon res/icon.ico
39
- CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -trimpath -ldflags "-s -w -X main.commitHash=`git describe --always --dirty` -X main.date=`date -u +%FT%TZ`" -o sftpgo-plugin-pubsub-windows-arm64.exe
42
+ CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -trimpath -ldflags "-s -w -X main.commitHash=`git describe --always --dirty` -X main.date=`date -u +%FT%TZ`" -o win/ sftpgo-plugin-pubsub-windows-arm64.exe
40
43
go-winres simply --arch 386 --product-version $VERSION-$GIT_COMMIT --file-version $FILE_VERSION --file-description "SFTPGo plugin pubsub" --product-name "SFTPGo plugin pubsub" --copyright "AGPL-3.0" --original-filename sftpgo-plugin-pubsub-windows-x86.exe --icon res/icon.ico
41
- CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -trimpath -ldflags "-s -w -X main.commitHash=`git describe --always --dirty` -X main.date=`date -u +%FT%TZ`" -o sftpgo-plugin-pubsub-windows-x86.exe
42
- echo $CERT_DATA | base64 --decode > cert.pfx
43
- osslsigncode sign -pkcs12 cert.pfx -pass $CERT_PASS -n "SFTPGo plugin pubsub" -i "https://github.com/sftpgo/sftpgo-plugin-pubsub" -ts "http://timestamp.sectigo.com" -h sha2 -in sftpgo-plugin-pubsub-windows-x86_64.exe -out bin/sftpgo-plugin-pubsub-windows-x86_64.exe
44
- osslsigncode sign -pkcs12 cert.pfx -pass $CERT_PASS -n "SFTPGo plugin pubsub" -i "https://github.com/sftpgo/sftpgo-plugin-pubsub" -ts "http://timestamp.sectigo.com" -h sha2 -in sftpgo-plugin-pubsub-windows-arm64.exe -out bin/sftpgo-plugin-pubsub-windows-arm64.exe
45
- osslsigncode sign -pkcs12 cert.pfx -pass $CERT_PASS -n "SFTPGo plugin pubsub" -i "https://github.com/sftpgo/sftpgo-plugin-pubsub" -ts "http://timestamp.sectigo.com" -h sha2 -in sftpgo-plugin-pubsub-windows-x86.exe -out bin/sftpgo-plugin-pubsub-windows-x86.exe
46
- rm -f cert.pfx *.exe *.syso
44
+ CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -trimpath -ldflags "-s -w -X main.commitHash=`git describe --always --dirty` -X main.date=`date -u +%FT%TZ`" -o win/sftpgo-plugin-pubsub-windows-x86.exe
47
45
48
46
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags "-s -w -X main.commitHash=`git describe --always --dirty` -X main.date=`date -u +%FT%TZ`" -o bin/sftpgo-plugin-pubsub-linux-amd64
49
47
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -trimpath -ldflags "-s -w -X main.commitHash=`git describe --always --dirty` -X main.date=`date -u +%FT%TZ`" -o bin/sftpgo-plugin-pubsub-linux-arm64
@@ -52,16 +50,20 @@ jobs:
52
50
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags "-s -w -X main.commitHash=`git describe --always --dirty` -X main.date=`date -u +%FT%TZ`" -o bin/sftpgo-plugin-pubsub-darwin-amd64
53
51
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags "-s -w -X main.commitHash=`git describe --always --dirty` -X main.date=`date -u +%FT%TZ`" -o bin/sftpgo-plugin-pubsub-darwin-arm64
54
52
shell : bash
55
- env :
56
- CERT_DATA : ${{ secrets.CERT_DATA }}
57
- CERT_PASS : ${{ secrets.CERT_PASS }}
53
+
54
+ - name : Upload Windows artifact
55
+ uses : actions/upload-artifact@v4
56
+ with :
57
+ name : win
58
+ path : win
59
+ retention-days : 1
58
60
59
61
- name : Prepare vendored sources
60
62
run : |
61
63
VERSION=${GITHUB_REF/refs\/tags\//}
62
64
go mod vendor
63
65
echo "${VERSION}" > VERSION.txt
64
- tar --exclude=bin -cJvf sftpgo-plugin-pubsub_${VERSION}_src_with_deps.tar.xz *
66
+ tar --exclude=bin --exclude=win - cJvf sftpgo-plugin-pubsub_${VERSION}_src_with_deps.tar.xz *
65
67
66
68
- name : Create release
67
69
run : |
72
74
gh release view "${VERSION}"
73
75
env :
74
76
GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
77
+
78
+ release-windows-binaries :
79
+ name : Release Windows binaries
80
+ environment : signing
81
+ needs : [build]
82
+ runs-on : windows-latest
83
+
84
+ steps :
85
+ - uses : actions/checkout@v4
86
+ with :
87
+ fetch-depth : 0
88
+
89
+ - name : Download artifact
90
+ uses : actions/download-artifact@v4
91
+ with :
92
+ name : win
93
+
94
+ - name : Azure login
95
+ uses : azure/login@v2
96
+ with :
97
+ client-id : ${{ secrets.AZURE_CLIENT_ID }}
98
+ tenant-id : ${{ secrets.AZURE_TENANT_ID }}
99
+ subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
100
+
101
+ - name : Sign
102
+
103
+ with :
104
+ endpoint : https://eus.codesigning.azure.net/
105
+ trusted-signing-account-name : nicola
106
+ certificate-profile-name : SFTPGo
107
+ files : |
108
+ ${{ github.workspace }}\sftpgo-plugin-pubsub-windows-x86_64.exe
109
+ ${{ github.workspace }}\sftpgo-plugin-pubsub-windows-arm64.exe
110
+ ${{ github.workspace }}\sftpgo-plugin-pubsub-windows-x86.exe
111
+ file-digest : SHA256
112
+ timestamp-rfc3161 : http://timestamp.acs.microsoft.com
113
+ timestamp-digest : SHA256
114
+ exclude-environment-credential : true
115
+ exclude-workload-identity-credential : true
116
+ exclude-managed-identity-credential : true
117
+ exclude-shared-token-cache-credential : true
118
+ exclude-visual-studio-credential : true
119
+ exclude-visual-studio-code-credential : true
120
+ exclude-azure-cli-credential : false
121
+ exclude-azure-powershell-credential : true
122
+ exclude-azure-developer-cli-credential : true
123
+ exclude-interactive-browser-credential : true
124
+
125
+ - name : Upload to release
126
+ run : |
127
+ VERSION=${GITHUB_REF/refs\/tags\//}
128
+ gh release upload "${VERSION}" sftpgo-plugin-pubsub-windows-x86_64.exe
129
+ gh release upload "${VERSION}" sftpgo-plugin-pubsub-windows-arm64.exe
130
+ gh release upload "${VERSION}" sftpgo-plugin-pubsub-windows-x86.exe
131
+ gh release view "${VERSION}"
132
+ shell : bash
133
+ env :
134
+ GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
0 commit comments