Skip to content

Commit fac002b

Browse files
authored
Update main.yml
1 parent c3b43dd commit fac002b

File tree

1 file changed

+75
-40
lines changed

1 file changed

+75
-40
lines changed

.github/workflows/main.yml

Lines changed: 75 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
# when PRs from forked repos are merged
44
push:
55
branches:
6-
- develop-4
6+
- develop
77
paths:
88
- 'bin/**'
99
- 'dev/**'
@@ -27,10 +27,10 @@ on:
2727

2828
env:
2929
ReleaseBranch: "master"
30+
MainRepo: "pyrevitlabs/pyRevit"
3031

3132
jobs:
3233
build:
33-
if: github.repository == 'pyrevitlabs/pyRevit'
3434
runs-on: windows-latest
3535
steps:
3636
- name: Report Context
@@ -49,10 +49,7 @@ jobs:
4949
uses: actions/checkout@v4
5050
with:
5151
fetch-depth: 0
52-
ref: ${{ github.head_ref }}
53-
54-
- name: Checkout Submodules
55-
uses: jmcouffin/submodules-init@ae47afe19152906d341ee759b39034176873f8ff
52+
submodules: recursive
5653

5754
- name: Prepare Python 3.10
5855
uses: actions/setup-python@v5
@@ -64,41 +61,57 @@ jobs:
6461
pip install pipenv
6562
pipenv install
6663
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+
6775
- name: Prepare msbuild
6876
uses: microsoft/setup-msbuild@v2
6977

7078
- name: Prepare git
79+
if: (github.repository == env.MainRepo)
7180
uses: fregante/setup-git-user@v2
7281

7382
- name: Check Build Environment
83+
if: (github.repository == env.MainRepo)
7484
run: pipenv run pyrevit check
7585

7686
- name: Update Copyright Info
87+
if: (github.repository == env.MainRepo)
7788
run: |
7889
pipenv run pyrevit set year
7990
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
88100

89101
# WIP only
90102
- name: Update Build Info (WIP)
91-
if: (github.base_ref != env.ReleaseBranch)
103+
if: (github.base_ref != env.ReleaseBranch && github.repository == env.MainRepo)
92104
run: |
93105
pipenv run pyrevit set build wip
94106
95107
# RELEASE only
96108
- name: Update Build Info (Release)
97-
if: (github.base_ref == env.ReleaseBranch)
109+
if: (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo)
98110
run: |
99111
pipenv run pyrevit set build release
100112
101113
- name: Publish Build Info
114+
if: (github.repository == env.MainRepo)
102115
run: |
103116
pipenv run pyrevit set products
104117
@@ -107,6 +120,7 @@ jobs:
107120
pipenv run pyrevit build products
108121
109122
- name: Get Build Version
123+
if: (github.repository == env.MainRepo)
110124
id: buildversion
111125
uses: juliangruber/read-file-action@v1
112126
with:
@@ -118,30 +132,51 @@ jobs:
118132
with:
119133
path: release/version
120134

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
129144

130145
- name: Build Installers
131146
run: |
132147
pipenv run pyrevit build installers
133148
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
142158

143159
# default retention period is 90 days
144160
# 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+
145180
- name: Upload Installers
146181
uses: actions/upload-artifact@v4
147182
with:
@@ -154,14 +189,14 @@ jobs:
154189
dist/pyRevit_CLI_${{ steps.installversion.outputs.content }}_admin_signed.msi
155190
dist/pyrevit-cli.${{ steps.installversion.outputs.content }}.nupkg
156191
- name: Generate Release Notes (Release)
157-
if: (github.base_ref == env.ReleaseBranch)
192+
if: (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo)
158193
env:
159194
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
160195
run: |
161196
pipenv run pyrevit report releasenotes > release_notes.md
162197
163198
- name: Commit & Tag Changes (Release)
164-
if: (github.base_ref == env.ReleaseBranch)
199+
if: (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo)
165200
# configure git and commit changes
166201
run: |
167202
pipenv run pyrevit build commit
@@ -170,7 +205,7 @@ jobs:
170205
171206
- name: Publish Release (Release)
172207
id: publish_release
173-
if: (github.base_ref == env.ReleaseBranch)
208+
if: (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo)
174209
uses: softprops/action-gh-release@v2
175210
env:
176211
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -189,13 +224,13 @@ jobs:
189224
dist/pyrevit-cli.${{ steps.installversion.outputs.content }}.nupkg
190225
191226
- name: Publish Choco Packages (Release)
192-
if: (github.base_ref == env.ReleaseBranch)
227+
if: (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo)
193228
run: |
194229
choco apikey --key ${{ secrets.CHOCO_TOKEN}} --source https://push.chocolatey.org/
195230
choco push dist/pyrevit-cli.${{ steps.installversion.outputs.content }}.nupkg -s https://push.chocolatey.org/
196231
197232
- name: Merge To Master (Release)
198-
if: (github.base_ref == env.ReleaseBranch)
233+
if: (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo)
199234
# configure git and commit changes
200235
run: |
201236
git checkout ${{ github.base_ref }}
@@ -204,21 +239,21 @@ jobs:
204239
git checkout ${{ github.head_ref }}
205240
206241
- name: Notify Issue Threads (WIP)
207-
if: (github.ref == 'refs/heads/develop')
242+
if: (github.ref == 'refs/heads/develop' && github.repository == env.MainRepo)
208243
env:
209244
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
210245
run: |
211246
pipenv run pyrevit notify wip https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
212247
213248
- name: Notify Issue Threads (Release)
214-
if: (github.base_ref == env.ReleaseBranch)
249+
if: (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo)
215250
env:
216251
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
217252
run: |
218253
pipenv run pyrevit notify release ${{ steps.publish_release.outputs.url }}
219254
220255
- name: Increment Version & Commit (Release)
221-
if: (github.base_ref == env.ReleaseBranch)
256+
if: (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo)
222257
run: |
223258
pipenv run pyrevit set next-version
224259
git push

0 commit comments

Comments
 (0)