44 push :
55 tags : ' v*'
66
7+ permissions :
8+ id-token : write
9+ contents : write
10+
711env :
812 GO_VERSION : 1.23.3
913
@@ -24,26 +28,20 @@ jobs:
2428
2529 - name : Build
2630 run : |
27- sudo apt-get update -q -y
28- sudo apt-get install -q -y osslsigncode
2931 go install github.com/tc-hib/go-winres@latest
3032
3133 VERSION=${GITHUB_REF/refs\/tags\//}
3234 GIT_COMMIT=`git describe --always --dirty`
3335 FILE_VERSION=${VERSION:1}.0
3436
3537 mkdir bin
38+ mkdir win
3639 go-winres simply --arch amd64 --product-version $VERSION-$GIT_COMMIT --file-version $FILE_VERSION --file-description "SFTPGo plugin eventsearch" --product-name "SFTPGo plugin eventsearch" --copyright "AGPL-3.0" --original-filename sftpgo-plugin-eventsearch-windows-x86_64.exe --icon res/icon.ico
37- CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags "-s -w -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.commitHash=`git describe --always --dirty` -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.buildDate=`date -u +%FT%TZ`" -o sftpgo-plugin-eventsearch-windows-x86_64.exe
40+ CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags "-s -w -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.commitHash=`git describe --always --dirty` -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.buildDate=`date -u +%FT%TZ`" -o win/ sftpgo-plugin-eventsearch-windows-x86_64.exe
3841 go-winres simply --arch amd64 --product-version $VERSION-$GIT_COMMIT --file-version $FILE_VERSION --file-description "SFTPGo plugin eventsearch" --product-name "SFTPGo plugin eventsearch" --copyright "AGPL-3.0" --original-filename sftpgo-plugin-eventsearch-windows-arm64.exe --icon res/icon.ico
39- CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -trimpath -ldflags "-s -w -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.commitHash=`git describe --always --dirty` -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.buildDate=`date -u +%FT%TZ`" -o sftpgo-plugin-eventsearch-windows-arm64.exe
42+ CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -trimpath -ldflags "-s -w -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.commitHash=`git describe --always --dirty` -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.buildDate=`date -u +%FT%TZ`" -o win/ sftpgo-plugin-eventsearch-windows-arm64.exe
4043 go-winres simply --arch amd64 --product-version $VERSION-$GIT_COMMIT --file-version $FILE_VERSION --file-description "SFTPGo plugin eventsearch" --product-name "SFTPGo plugin eventsearch" --copyright "AGPL-3.0" --original-filename sftpgo-plugin-eventsearch-windows-x86.exe --icon res/icon.ico
41- CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -trimpath -ldflags "-s -w -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.commitHash=`git describe --always --dirty` -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.buildDate=`date -u +%FT%TZ`" -o sftpgo-plugin-eventsearch-windows-x86.exe
42- echo $CERT_DATA | base64 --decode > cert.pfx
43- osslsigncode sign -pkcs12 cert.pfx -pass $CERT_PASS -n "SFTPGo plugin eventsearch" -i "https://github.com/sftpgo/sftpgo-plugin-eventsearch" -ts "http://timestamp.sectigo.com" -h sha2 -in sftpgo-plugin-eventsearch-windows-x86_64.exe -out bin/sftpgo-plugin-eventsearch-windows-x86_64.exe
44- osslsigncode sign -pkcs12 cert.pfx -pass $CERT_PASS -n "SFTPGo plugin eventsearch" -i "https://github.com/sftpgo/sftpgo-plugin-eventsearch" -ts "http://timestamp.sectigo.com" -h sha2 -in sftpgo-plugin-eventsearch-windows-arm64.exe -out bin/sftpgo-plugin-eventsearch-windows-arm64.exe
45- osslsigncode sign -pkcs12 cert.pfx -pass $CERT_PASS -n "SFTPGo plugin eventsearch" -i "https://github.com/sftpgo/sftpgo-plugin-eventsearch" -ts "http://timestamp.sectigo.com" -h sha2 -in sftpgo-plugin-eventsearch-windows-x86.exe -out bin/sftpgo-plugin-eventsearch-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 github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.commitHash=`git describe --always --dirty` -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.buildDate=`date -u +%FT%TZ`" -o win/sftpgo-plugin-eventsearch-windows-x86.exe
4745
4846 CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags "-s -w -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.commitHash=`git describe --always --dirty` -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.buildDate=`date -u +%FT%TZ`" -o bin/sftpgo-plugin-eventsearch-linux-amd64
4947 CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -trimpath -ldflags "-s -w -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.commitHash=`git describe --always --dirty` -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.buildDate=`date -u +%FT%TZ`" -o bin/sftpgo-plugin-eventsearch-linux-arm64
@@ -52,16 +50,20 @@ jobs:
5250 CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags "-s -w -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.commitHash=`git describe --always --dirty` -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.buildDate=`date -u +%FT%TZ`" -o bin/sftpgo-plugin-eventsearch-darwin-amd64
5351 CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags "-s -w -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.commitHash=`git describe --always --dirty` -X github.com/sftpgo/sftpgo-plugin-eventsearch/cmd.buildDate=`date -u +%FT%TZ`" -o bin/sftpgo-plugin-eventsearch-darwin-arm64
5452 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
5860
5961 - name : Prepare vendored sources
6062 run : |
6163 VERSION=${GITHUB_REF/refs\/tags\//}
6264 go mod vendor
6365 echo "${VERSION}" > VERSION.txt
64- tar --exclude=bin -cJvf sftpgo-plugin-eventsearch_${VERSION}_src_with_deps.tar.xz *
66+ tar --exclude=bin --exclude=win - cJvf sftpgo-plugin-eventsearch_${VERSION}_src_with_deps.tar.xz *
6567
6668 - name : Create release
6769 run : |
7274 gh release view "${VERSION}"
7375 env :
7476 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-eventsearch-windows-x86_64.exe
109+ ${{ github.workspace }}\sftpgo-plugin-eventsearch-windows-arm64.exe
110+ ${{ github.workspace }}\sftpgo-plugin-eventsearch-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-eventsearch-windows-x86_64.exe
129+ gh release upload "${VERSION}" sftpgo-plugin-eventsearch-windows-arm64.exe
130+ gh release upload "${VERSION}" sftpgo-plugin-eventsearch-windows-x86.exe
131+ gh release view "${VERSION}"
132+ shell : bash
133+ env :
134+ GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
0 commit comments