Skip to content

Commit f5b9872

Browse files
committed
Make testing easier
1 parent 6e3043c commit f5b9872

File tree

2 files changed

+47
-43
lines changed

2 files changed

+47
-43
lines changed

windows-release/merge-and-upload.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
def find_cmd(env, exe):
2727
cmd = os.getenv(env)
2828
if cmd:
29-
return Path(cmd)
29+
cmd = Path(cmd)
30+
if not cmd.is_file():
31+
raise RuntimeError(f"Could not find {cmd} to perform upload. Incorrect %{env}% setting.")
32+
return cmd
3033
for p in os.getenv("PATH", "").split(";"):
3134
if p:
3235
cmd = Path(p) / exe

windows-release/stage-publish-pymanager.yml

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,12 @@ jobs:
6262
artifact: pymanager_${{ a.name }}
6363
targetPath: $(Build.BinariesDirectory)\${{ a.name }}
6464

65-
- task: DownloadSecureFile@1
66-
name: sshkey
67-
inputs:
68-
secureFile: pydotorg-ssh.ppk
69-
displayName: 'Download PuTTY key'
65+
- ${{ if eq(parameters.SigningCertificate, 'PythonSoftwareFoundation') }}:
66+
- task: DownloadSecureFile@1
67+
name: sshkey
68+
inputs:
69+
secureFile: pydotorg-ssh.ppk
70+
displayName: 'Download PuTTY key'
7071

7172
- powershell: |
7273
git clone https://github.com/python/cpython-bin-deps --revision 9f9e6fc31a55406ee5ff0198ea47bbb445eeb942 --depth 1 --progress -v "putty"
@@ -95,44 +96,44 @@ jobs:
9596
FILENAME: $(PyManagerIndexFilename)
9697
displayName: 'Infer index filename'
9798
98-
- powershell: |
99-
"Uploading following packages:"
100-
(dir "__install__.*.json").FullName
101-
(dir "*\__install__.json").FullName
102-
python "$(Build.SourcesDirectory)\windows-release\merge-and-upload.py"
103-
workingDirectory: $(Build.BinariesDirectory)
104-
condition: and(succeeded(), ne(variables['IsRealSigned'], 'true'))
105-
displayName: 'Produce uploadable ZIPs'
106-
env:
107-
NO_UPLOAD: 1
108-
INDEX_URL: '$(PyDotOrgUrlPrefix)python/$(_PyManagerIndexFilename)'
109-
INDEX_FILE: '$(Build.ArtifactStagingDirectory)\index\$(_PyManagerIndexFilename)'
110-
MANIFEST_FILE: '$(Build.ArtifactStagingDirectory)\index\windows.json'
111-
${{ if variables['SIGN_COMMAND'] }}:
112-
MAKECAT: $(MAKECAT)
113-
SIGN_COMMAND: $(SIGN_COMMAND)
99+
- ${{ if ne(parameters.SigningCertificate, 'PythonSoftwareFoundation') }}:
100+
- powershell: |
101+
"Preparing following packages:"
102+
(dir "__install__.*.json").FullName
103+
(dir "*\__install__.json").FullName
104+
python "$(Build.SourcesDirectory)\windows-release\merge-and-upload.py"
105+
workingDirectory: $(Build.BinariesDirectory)
106+
displayName: 'Produce uploadable ZIPs (no upload)'
107+
env:
108+
NO_UPLOAD: 1
109+
INDEX_URL: '$(PyDotOrgUrlPrefix)python/$(_PyManagerIndexFilename)'
110+
INDEX_FILE: '$(Build.ArtifactStagingDirectory)\index\$(_PyManagerIndexFilename)'
111+
MANIFEST_FILE: '$(Build.ArtifactStagingDirectory)\index\windows.json'
112+
${{ if variables['SIGN_COMMAND'] }}:
113+
MAKECAT: $(MAKECAT)
114+
SIGN_COMMAND: $(SIGN_COMMAND)
114115
115-
- powershell: |
116-
"Uploading following packages:"
117-
(dir "__install__.*.json").FullName
118-
(dir "*\__install__.json").FullName
119-
python "$(Build.SourcesDirectory)\windows-release\merge-and-upload.py"
120-
workingDirectory: $(Build.BinariesDirectory)
121-
condition: and(succeeded(), eq(variables['IsRealSigned'], 'true'))
122-
displayName: 'Upload ZIPs'
123-
env:
124-
INDEX_URL: '$(PyDotOrgUrlPrefix)python/$(_PyManagerIndexFilename)'
125-
INDEX_FILE: '$(Build.ArtifactStagingDirectory)\index\$(_PyManagerIndexFilename)'
126-
MANIFEST_FILE: '$(Build.ArtifactStagingDirectory)\index\windows.json'
127-
UPLOAD_URL_PREFIX: $(PyDotOrgUrlPrefix)
128-
UPLOAD_PATH_PREFIX: $(PyDotOrgUploadPathPrefix)
129-
UPLOAD_HOST: $(PyDotOrgServer)
130-
UPLOAD_HOST_KEY: $(PyDotOrgHostKey)
131-
UPLOAD_USER: $(PyDotOrgUsername)
132-
UPLOAD_KEYFILE: $(sshkey.secureFilePath)
133-
${{ if variables['SIGN_COMMAND'] }}:
134-
MAKECAT: $(MAKECAT)
135-
SIGN_COMMAND: $(SIGN_COMMAND)
116+
- ${{ else }}:
117+
- powershell: |
118+
"Uploading following packages:"
119+
(dir "__install__.*.json").FullName
120+
(dir "*\__install__.json").FullName
121+
python "$(Build.SourcesDirectory)\windows-release\merge-and-upload.py"
122+
workingDirectory: $(Build.BinariesDirectory)
123+
displayName: 'Upload ZIPs'
124+
env:
125+
INDEX_URL: '$(PyDotOrgUrlPrefix)python/$(_PyManagerIndexFilename)'
126+
INDEX_FILE: '$(Build.ArtifactStagingDirectory)\index\$(_PyManagerIndexFilename)'
127+
MANIFEST_FILE: '$(Build.ArtifactStagingDirectory)\index\windows.json'
128+
UPLOAD_URL_PREFIX: $(PyDotOrgUrlPrefix)
129+
UPLOAD_PATH_PREFIX: $(PyDotOrgUploadPathPrefix)
130+
UPLOAD_HOST: $(PyDotOrgServer)
131+
UPLOAD_HOST_KEY: $(PyDotOrgHostKey)
132+
UPLOAD_USER: $(PyDotOrgUsername)
133+
UPLOAD_KEYFILE: $(sshkey.secureFilePath)
134+
${{ if variables['SIGN_COMMAND'] }}:
135+
MAKECAT: $(MAKECAT)
136+
SIGN_COMMAND: $(SIGN_COMMAND)
136137
137138
- ${{ each alg in parameters.HashAlgorithms }}:
138139
- powershell: |

0 commit comments

Comments
 (0)