forked from sabrogden/Ditto
-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (130 loc) · 6.19 KB
/
build.yml
File metadata and controls
155 lines (130 loc) · 6.19 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: MSBuild
on:
push:
branches:
- master
paths-ignore:
- '**/*.md'
env:
SOLUTION_FILE_PATH: CP_Main_10.sln
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Generate build number
id: buildnumber
uses: onyxmueller/build-tag-number@v1
with:
token: ${{secrets.GITHUB_TOKEN}}
- name: Set the value
run: |
echo "VERSION_FILENAME=3_25_${env:BUILD_NUMBER}_0" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "VERSION_DOT_FILENAME=3.25.${env:BUILD_NUMBER}.0" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- name: Build
run: msbuild CP_Main_10.sln /p:Configuration=Release /p:Platform=x64
- name: Set Versions
run: |
DittoSetup\rcedit-x64 Release64\Ditto.exe --set-file-version ${{env.VERSION_DOT_FILENAME}} --set-product-version ${{env.VERSION_DOT_FILENAME}}
- name: upload-unsigned-exe
id: upload-unsigned-exe
uses: actions/upload-artifact@v4
with:
name: unsigned-exe
retention-days: 1
path: |
Release64\Ditto.exe
Release64\ICU_Loader.dll
Release64\Addins\DittoUtil.dll
- id: sign-exe
uses: signpath/github-action-submit-signing-request@v1.1
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: 'fcf33ea4-4343-46b3-be50-f8fe64e1a900'
project-slug: 'Ditto'
artifact-configuration-slug: 'exe'
signing-policy-slug: 'release-signing'
github-artifact-id: '${{ steps.upload-unsigned-exe.outputs.artifact-id }}'
wait-for-completion: true
output-artifact-directory: '/Release64'
- name: Installer
uses: Minionguyjpro/Inno-Setup-Action@v1.2.7
with:
path: DittoSetup\DittoSetup_10.iss
- name: upload-unsigned-artifact
id: upload-unsigned-artifact
uses: actions/upload-artifact@v4
with:
name: unsigned-intaller
retention-days: 1
path: DittoSetup\output\DittoSetup_${{env.VERSION_FILENAME}}.exe
- id: sing-installer
uses: signpath/github-action-submit-signing-request@v1.1
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: 'fcf33ea4-4343-46b3-be50-f8fe64e1a900'
project-slug: 'Ditto'
artifact-configuration-slug: 'Installer'
signing-policy-slug: 'release-signing'
github-artifact-id: '${{ steps.upload-unsigned-artifact.outputs.artifact-id }}'
wait-for-completion: true
output-artifact-directory: '/DittoSetup/output'
- name: Build Portable
run: |
DittoSetup\BuildPortableZIP.bat "DittoPortable_${{env.VERSION_FILENAME}}" bit64
- name: Zip Debug Files
run: |
7z a DittoSetup\output\DittoDebug_${{env.VERSION_FILENAME}}.7z *.pdb -r
7z a DittoSetup\output\DittoDebug_${{env.VERSION_FILENAME}}.7z *.map -r
- name: Choco - Ditto
run: |
(Get-Content 'DittoSetup\Chocolatey\ditto.nuspec' -Raw).Replace("%version%", "${{env.VERSION_DOT_FILENAME}}") | Out-File 'DittoSetup\Chocolatey\ditto.nuspec'
copy DittoSetup\Output\DittoSetup_${{env.VERSION_FILENAME}}.exe DittoSetup\Chocolatey\tools\DittoSetup_${{env.VERSION_FILENAME}}.exe
cd DittoSetup\Chocolatey
choco pack
choco push --source https://push.chocolatey.org/ --key ${{ secrets.CHOCO_API_KEY}}
cd ..
cd ..
- name: Choco - Ditto.Install
run: |
(Get-Content 'DittoSetup\Chocolatey.install\ditto.nuspec' -Raw).Replace("%version%", "${{env.VERSION_DOT_FILENAME}}") | Out-File 'DittoSetup\Chocolatey.install\ditto.nuspec'
copy DittoSetup\output\DittoSetup_${{env.VERSION_FILENAME}}.exe DittoSetup\Chocolatey.install\tools\DittoSetup_${{env.VERSION_FILENAME}}.exe
cd DittoSetup\Chocolatey.install
choco pack
choco push --source https://push.chocolatey.org/ --key ${{ secrets.CHOCO_API_KEY}}
cd ..
cd ..
- name: Choco - Ditto.Portable
run: |
(Get-Content 'DittoSetup\Chocolatey.portable\ditto.nuspec' -Raw).Replace("%version%", "${{env.VERSION_DOT_FILENAME}}") | Out-File 'DittoSetup\Chocolatey.portable\ditto.nuspec'
copy DittoSetup\output\DittoPortable_${{env.VERSION_FILENAME}}.zip DittoSetup\Chocolatey.portable\tools\DittoPortable_${{env.VERSION_FILENAME}}.zip
cd DittoSetup\Chocolatey.portable
choco pack
choco push --source https://push.chocolatey.org/ --key ${{ secrets.CHOCO_API_KEY}}
cd ..
cd ..
- name: Build appx
run: |
7z x DittoSetup\output\DittoPortable_${{env.VERSION_FILENAME}}.zip -oDittoSetup\appx -r
(Get-Content 'DittoSetup\appx\appxmanifest.xml' -Raw).Replace("%version%", "${{env.VERSION_DOT_FILENAME}}") | Out-File 'DittoSetup\appx\appxmanifest.xml'
cd DittoSetup\appx
$env:Path += ";C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x86"
makeappx.exe pack /f files.ini /p Ditto_${{env.VERSION_FILENAME}}.appx
signtool.exe sign -f my.pfx -fd SHA256 -v Ditto_${{env.VERSION_FILENAME}}.appx
cd ..
cd ..
copy DittoSetup\appx\Ditto_${{env.VERSION_FILENAME}}.appx DittoSetup\Output\Ditto_${{env.VERSION_FILENAME}}.appx
- name: Publish to GitHub
env:
token: ${{secrets.GITHUB_TOKEN}}
uploadPath: DittoSetup\output\
tag: ${{env.VERSION_FILENAME}}
previous_tag: 3.25.113.0
run: |
npm install ./DittoSetup/GitHubRelease
node ./DittoSetup/GitHubRelease/index.js