3
3
# when PRs from forked repos are merged
4
4
push :
5
5
branches :
6
- - develop-4
6
+ - develop
7
7
paths :
8
8
- ' bin/**'
9
9
- ' dev/**'
27
27
28
28
env :
29
29
ReleaseBranch : " master"
30
+ MainRepo : " pyrevitlabs/pyRevit"
30
31
31
32
jobs :
32
33
build :
33
- if : github.repository == 'pyrevitlabs/pyRevit'
34
34
runs-on : windows-latest
35
35
steps :
36
36
- name : Report Context
49
49
uses : actions/checkout@v4
50
50
with :
51
51
fetch-depth : 0
52
- ref : ${{ github.head_ref }}
53
-
54
- - name : Checkout Submodules
55
- uses : jmcouffin/submodules-init@ae47afe19152906d341ee759b39034176873f8ff
52
+ submodules : recursive
56
53
57
54
- name : Prepare Python 3.10
58
55
uses : actions/setup-python@v5
@@ -64,41 +61,57 @@ jobs:
64
61
pip install pipenv
65
62
pipenv install
66
63
64
+ # needed for MahApps XamlColorSchemeGenerator
65
+ - name : Prepare .NET 3.1
66
+ uses : actions/setup-dotnet@v4
67
+ with :
68
+ dotnet-version : 3.1.x
69
+
70
+ - name : Prepare .NET 8.0
71
+ uses : actions/setup-dotnet@v4
72
+ with :
73
+ dotnet-version : 8.0.x
74
+
67
75
- name : Prepare msbuild
68
76
uses : microsoft/setup-msbuild@v2
69
77
70
78
- name : Prepare git
79
+ if : (github.repository == env.MainRepo)
71
80
uses : fregante/setup-git-user@v2
72
81
73
82
- name : Check Build Environment
83
+ if : (github.repository == env.MainRepo)
74
84
run : pipenv run pyrevit check
75
85
76
86
- name : Update Copyright Info
87
+ if : (github.repository == env.MainRepo)
77
88
run : |
78
89
pipenv run pyrevit set year
79
90
80
- - name : Update Certificate
81
- env :
82
- CERTIFICATE : ${{ secrets.CERTIFICATE }}
83
- CERTIFICATEPASSWORD : ${{ secrets.PASSWORD }}
84
- CERTIFICATESHA1 : " ${{ secrets.CERTIFICATESHA1 }}"
85
- CERTIFICATENAME : " ${{ secrets.CERTIFICATENAME }}"
86
- run : |
87
- pipenv run pyrevit sign addcert
91
+ # - name: Update Certificate
92
+ # if: (github.repository == env.MainRepo)
93
+ # env:
94
+ # CERTIFICATE: ${{ secrets.CERTIFICATE }}
95
+ # CERTIFICATEPASSWORD: ${{ secrets.PASSWORD }}
96
+ # CERTIFICATESHA1: "${{ secrets.CERTIFICATESHA1 }}"
97
+ # CERTIFICATENAME: "${{ secrets.CERTIFICATENAME }}"
98
+ # run: |
99
+ # pipenv run pyrevit sign addcert
88
100
89
101
# WIP only
90
102
- name : Update Build Info (WIP)
91
- if : (github.base_ref != env.ReleaseBranch)
103
+ if : (github.base_ref != env.ReleaseBranch && github.repository == env.MainRepo )
92
104
run : |
93
105
pipenv run pyrevit set build wip
94
106
95
107
# RELEASE only
96
108
- name : Update Build Info (Release)
97
- if : (github.base_ref == env.ReleaseBranch)
109
+ if : (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo )
98
110
run : |
99
111
pipenv run pyrevit set build release
100
112
101
113
- name : Publish Build Info
114
+ if : (github.repository == env.MainRepo)
102
115
run : |
103
116
pipenv run pyrevit set products
104
117
@@ -107,6 +120,7 @@ jobs:
107
120
pipenv run pyrevit build products
108
121
109
122
- name : Get Build Version
123
+ if : (github.repository == env.MainRepo)
110
124
id : buildversion
111
125
uses : juliangruber/read-file-action@v1
112
126
with :
@@ -118,30 +132,51 @@ jobs:
118
132
with :
119
133
path : release/version
120
134
121
- - name : Sign Products
122
- env :
123
- CERTIFICATE : ${{ secrets.CERTIFICATE }}
124
- CERTIFICATEPASSWORD : ${{ secrets.PASSWORD }}
125
- CERTIFICATESHA1 : " ${{ secrets.CERTIFICATESHA1 }}"
126
- CERTIFICATENAME : " ${{ secrets.CERTIFICATENAME }}"
127
- run : |
128
- pipenv run pyrevit sign products
135
+ # - name: Sign Products
136
+ # if: (github.repository == env.MainRepo)
137
+ # env:
138
+ # CERTIFICATE: ${{ secrets.CERTIFICATE }}
139
+ # CERTIFICATEPASSWORD: ${{ secrets.PASSWORD }}
140
+ # CERTIFICATESHA1: "${{ secrets.CERTIFICATESHA1 }}"
141
+ # CERTIFICATENAME: "${{ secrets.CERTIFICATENAME }}"
142
+ # run: |
143
+ # pipenv run pyrevit sign products
129
144
130
145
- name : Build Installers
131
146
run : |
132
147
pipenv run pyrevit build installers
133
148
134
- - name : Sign Installers
135
- env :
136
- CERTIFICATE : ${{ secrets.CERTIFICATE }}
137
- CERTIFICATEPASSWORD : ${{ secrets.PASSWORD }}
138
- CERTIFICATESHA1 : " ${{ secrets.CERTIFICATESHA1 }}"
139
- CERTIFICATENAME : " ${{ secrets.CERTIFICATENAME }}"
140
- run : |
141
- pipenv run pyrevit sign installers
149
+ # - name: Sign Installers
150
+ # if: (github.repository == env.MainRepo)
151
+ # env:
152
+ # CERTIFICATE: ${{ secrets.CERTIFICATE }}
153
+ # CERTIFICATEPASSWORD: ${{ secrets.PASSWORD }}
154
+ # CERTIFICATESHA1: "${{ secrets.CERTIFICATESHA1 }}"
155
+ # CERTIFICATENAME: "${{ secrets.CERTIFICATENAME }}"
156
+ # run: |
157
+ # pipenv run pyrevit sign installers
142
158
143
159
# default retention period is 90 days
144
160
# https://github.com/marketplace/actions/upload-a-build-artifact#retention-period
161
+
162
+ - name : Sign files with Trusted Signing
163
+ if : (github.repository == env.MainRepo)
164
+ uses : azure/trusted-signing-action@v0.5.1
165
+ with :
166
+ azure-tenant-id : ${{ secrets.AZURE_TENANT_ID }}
167
+ azure-client-id : ${{ secrets.AZURE_CLIENT_ID }}
168
+ azure-client-secret : ${{ secrets.AZURE_CLIENT_SECRET }}
169
+ endpoint : ${{ secrets.AZURE_ENDPOINT }}
170
+ trusted-signing-account-name : ${{ secrets.AZURE_CODE_SIGNING_NAME }}
171
+ certificate-profile-name : ${{ secrets.AZURE_CERT_PROFILE_NAME }}
172
+
173
+ # Sign all exes inside the folder
174
+ files-folder : dist/
175
+ files-folder-filter : exe,msi
176
+ file-digest : SHA256
177
+ timestamp-rfc3161 : http://timestamp.acs.microsoft.com
178
+ timestamp-digest : SHA256
179
+
145
180
- name : Upload Installers
146
181
uses : actions/upload-artifact@v4
147
182
with :
@@ -154,14 +189,14 @@ jobs:
154
189
dist/pyRevit_CLI_${{ steps.installversion.outputs.content }}_admin_signed.msi
155
190
dist/pyrevit-cli.${{ steps.installversion.outputs.content }}.nupkg
156
191
- name : Generate Release Notes (Release)
157
- if : (github.base_ref == env.ReleaseBranch)
192
+ if : (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo )
158
193
env :
159
194
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
160
195
run : |
161
196
pipenv run pyrevit report releasenotes > release_notes.md
162
197
163
198
- name : Commit & Tag Changes (Release)
164
- if : (github.base_ref == env.ReleaseBranch)
199
+ if : (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo )
165
200
# configure git and commit changes
166
201
run : |
167
202
pipenv run pyrevit build commit
@@ -170,7 +205,7 @@ jobs:
170
205
171
206
- name : Publish Release (Release)
172
207
id : publish_release
173
- if : (github.base_ref == env.ReleaseBranch)
208
+ if : (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo )
174
209
uses : softprops/action-gh-release@v2
175
210
env :
176
211
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -189,13 +224,13 @@ jobs:
189
224
dist/pyrevit-cli.${{ steps.installversion.outputs.content }}.nupkg
190
225
191
226
- name : Publish Choco Packages (Release)
192
- if : (github.base_ref == env.ReleaseBranch)
227
+ if : (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo )
193
228
run : |
194
229
choco apikey --key ${{ secrets.CHOCO_TOKEN}} --source https://push.chocolatey.org/
195
230
choco push dist/pyrevit-cli.${{ steps.installversion.outputs.content }}.nupkg -s https://push.chocolatey.org/
196
231
197
232
- name : Merge To Master (Release)
198
- if : (github.base_ref == env.ReleaseBranch)
233
+ if : (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo )
199
234
# configure git and commit changes
200
235
run : |
201
236
git checkout ${{ github.base_ref }}
@@ -204,21 +239,21 @@ jobs:
204
239
git checkout ${{ github.head_ref }}
205
240
206
241
- name : Notify Issue Threads (WIP)
207
- if : (github.ref == 'refs/heads/develop')
242
+ if : (github.ref == 'refs/heads/develop' && github.repository == env.MainRepo )
208
243
env :
209
244
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
210
245
run : |
211
246
pipenv run pyrevit notify wip https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
212
247
213
248
- name : Notify Issue Threads (Release)
214
- if : (github.base_ref == env.ReleaseBranch)
249
+ if : (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo )
215
250
env :
216
251
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
217
252
run : |
218
253
pipenv run pyrevit notify release ${{ steps.publish_release.outputs.url }}
219
254
220
255
- name : Increment Version & Commit (Release)
221
- if : (github.base_ref == env.ReleaseBranch)
256
+ if : (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo )
222
257
run : |
223
258
pipenv run pyrevit set next-version
224
259
git push
0 commit comments