Skip to content

Commit 95a102c

Browse files
authored
Code-signing (#78)
1 parent 98e2bda commit 95a102c

File tree

4 files changed

+94
-19
lines changed

4 files changed

+94
-19
lines changed

.github/build/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ outputs:
3333
path:
3434
description: 'Build output path'
3535
value: ${{ steps.build.outputs.path }}
36+
version:
37+
description: 'Program version'
38+
value: ${{ steps.build.outputs.version }}
39+
artifact-id:
40+
description: 'Build output artifact ID'
41+
value: ${{ steps.upload.outputs.artifact-id }}
3642

3743
runs:
3844
using: 'composite'
@@ -55,9 +61,12 @@ runs:
5561
msbuild /r /p:Configuration=${{ inputs.configuration }} /p:Flavor=${{ inputs.flavor }} ${{ inputs.build_options }}
5662
copy LICENSE ${{ inputs.project_directory }}\bin\${{ inputs.configuration }}
5763
echo "path=${{ inputs.project_directory }}\bin\${{ inputs.configuration }}" >> $env:GITHUB_OUTPUT
64+
$VERSION=(Get-Item -Path ${{ inputs.project_directory }}\bin\${{ inputs.configuration }}\*.exe).VersionInfo.ProductVersion
65+
echo "version=$VERSION" >> $env:GITHUB_OUTPUT
5866
shell: pwsh
5967

6068
- name: Upload build artifacts
69+
id: upload
6170
if: ${{ inputs.artifact != '' }}
6271
uses: actions/upload-artifact@v4
6372
with:

.github/workflows/dotnet-release.yml

Lines changed: 70 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,66 +8,121 @@ on:
88

99
jobs:
1010

11-
portable-build:
11+
portable:
1212
runs-on: windows-2019
1313
steps:
1414
- uses: actions/checkout@v4
15+
1516
- uses: ./.github/build
17+
id: build
1618
with:
1719
configuration: Release
1820
flavor: Portable
1921
artifact: release_artifact_portable
2022

21-
portable-publish:
22-
runs-on: windows-2019
23-
needs: portable-build
24-
steps:
25-
- name: Collect artifact
26-
uses: actions/download-artifact@v4
27-
with:
28-
name: release_artifact_portable
29-
path: release_artifact_portable
3023
- name: Create zip
31-
run: Compress-Archive -Path release_artifact_portable/* -Destination release_artifact_portable.zip
32-
#run: tar -cvzf release_artifact_portable.tar.gz -C release_artifact_portable *
24+
run: Compress-Archive -Path ${{steps.build.outputs.path}}/* -Destination release_artifact_portable_unsigned.zip
25+
3326
- name: Upload release artifact
3427
uses: actions/upload-release-asset@v1
3528
env:
3629
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3730
with:
3831
upload_url: ${{ github.event.release.upload_url }}
39-
asset_path: release_artifact_portable.zip
40-
asset_name: PasteIntoFile_${{ github.event.release.tag_name }}_portable.zip
32+
asset_path: release_artifact_portable_unsigned.zip
33+
asset_name: PasteIntoFile_${{ github.event.release.tag_name }}_portable_unsigned.zip
34+
asset_content_type: application/zip
35+
36+
- name: Sign with Signpath
37+
uses: signpath/[email protected]
38+
with:
39+
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
40+
organization-id: '030bee06-17be-4a2a-a788-9efdbd14a889'
41+
project-slug: 'PasteIntoFile'
42+
signing-policy-slug: 'release-signing'
43+
artifact-configuration-slug: 'portable'
44+
github-artifact-id: '${{ steps.build.outputs.artifact-id }}'
45+
parameters: |
46+
version: "${{ steps.build.outputs.version }}"
47+
wait-for-completion: true
48+
output-artifact-directory: 'signing_result'
49+
50+
- name: Create zip
51+
run: Compress-Archive -Path signing_result/* -Destination release_artifact_portable_signed.zip
52+
53+
- name: Upload signed release artifact
54+
uses: actions/upload-release-asset@v1
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
with:
58+
upload_url: ${{ github.event.release.upload_url }}
59+
asset_path: release_artifact_portable_signed.zip
60+
asset_name: PasteIntoFile_${{ github.event.release.tag_name }}_portable_signed.zip
4161
asset_content_type: application/zip
4262

4363
installer:
4464
runs-on: windows-2019
4565
steps:
4666
- name: Checkout
4767
uses: actions/checkout@v4
68+
4869
- name: Build program executable
4970
id: build
5071
uses: ./.github/build
5172
with:
5273
configuration: Release
5374
flavor: Installer
75+
5476
- name: Add WiX toolkit to PATH
5577
shell: bash
5678
run: echo "${WIX}bin" >> $GITHUB_PATH
79+
5780
- name: Build MSI file with WiX toolchain
5881
run: |
5982
cd Installer
6083
heat dir ../${{steps.build.outputs.path}} -dr INSTALLFOLDER -ag -cg ReleaseFragment -ke -srd -sfrag -nologo -pog:Binaries -pog:Documents -pog: Satellites -pog:Sources -pog:Content -t releaseFiles.xslt -out releaseFiles.wxs
6184
candle releaseFiles.wxs
6285
candle PasteIntoFile.wxs
6386
light -b ../${{steps.build.outputs.path}} releaseFiles.wixobj PasteIntoFile.wixobj -ext WixNetFxExtension -out Installer.msi
87+
6488
- name: Upload release artifact
6589
uses: actions/upload-release-asset@v1
6690
env:
6791
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6892
with:
6993
upload_url: ${{ github.event.release.upload_url }}
7094
asset_path: Installer/Installer.msi
71-
asset_name: PasteIntoFile_${{ github.event.release.tag_name }}_installer.msi
95+
asset_name: PasteIntoFile_${{ github.event.release.tag_name }}_installer_unsigned.msi
7296
asset_content_type: application/msi
7397

98+
99+
- name: Upload artifact for signing
100+
id: upload
101+
uses: actions/upload-artifact@v4
102+
with:
103+
path: Installer/Installer.msi
104+
105+
- name: Sign with Signpath
106+
uses: signpath/[email protected]
107+
with:
108+
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
109+
organization-id: '030bee06-17be-4a2a-a788-9efdbd14a889'
110+
project-slug: 'PasteIntoFile'
111+
signing-policy-slug: 'release-signing'
112+
artifact-configuration-slug: 'installer-zip'
113+
github-artifact-id: '${{ steps.upload.outputs.artifact-id }}'
114+
parameters: |
115+
version: "${{ steps.build.outputs.version }}"
116+
wait-for-completion: true
117+
output-artifact-directory: 'signing_result'
118+
119+
- name: Upload signed release artifact
120+
uses: actions/upload-release-asset@v1
121+
env:
122+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123+
with:
124+
upload_url: ${{ github.event.release.upload_url }}
125+
asset_path: signing_result/Installer.msi
126+
asset_name: PasteIntoFile_${{ github.event.release.tag_name }}_installer_signed.msi
127+
asset_content_type: application/msi
128+

PRIVACY

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
Paste Into File Privacy Policy
22
------------------------------
33

4-
Paste Into File reads data in your clipboard and saves it to a local file on your computer at your request. That is what it is made for.
5-
6-
Other than that, your data is not collected, used, transferred, shared or otherwise utilized.
7-
4+
This program reads/writes data to/from your clipboard and local files at your request.
5+
This program will not transfer any information to other networked systems.
86

97

108

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,16 @@ Copyright © PasteIntoFile GitHub contributors
197197
PasteIntoFile copy path_to/the_file
198198
```
199199

200+
## Code signing policy
201+
202+
Free code signing provided by [SignPath.io](https://about.signpath.io/), certificate by [SignPath Foundation](https://signpath.org/)
203+
- Committers and reviewers: [Contributors](https://github.com/eltos/PasteIntoFile/graphs/contributors)
204+
- Approvers: [Owner](https://github.com/eltos)
205+
206+
## Privacy Policy
207+
208+
See [PRIVACY](PRIVACY) file
209+
210+
## License
211+
212+
See [LICENSE](LICENSE) file

0 commit comments

Comments
 (0)