Skip to content

Commit

Permalink
Move variables to build stage; strip Linux executable to reduce file …
Browse files Browse the repository at this point in the history
…size
  • Loading branch information
vsalvino committed Oct 30, 2022
1 parent 732b28a commit 08d7a1a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
21 changes: 10 additions & 11 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,6 @@ trigger:
- main
- refs/tags/*

variables:
# Tags starting with "v" are considered a release and should sign
# and publish the binaries.
- name: CR_RELEASE
value: $[startsWith(variables['Build.SourceBranch'], 'refs/tags/v')]
# Main Python version for building distributables.
- name: CR_PY_VERSION
value: '3.10'
# Link the group of Apple passwords from pipeline library.
- group: 'Apple IDs'

stages:
- stage: Quality_Control
displayName: Quality Control
Expand Down Expand Up @@ -73,6 +62,16 @@ stages:
displayName: Build Distributables
dependsOn: Quality_Control
condition: succeeded('Quality_Control')
variables:
# Tags starting with "v" are considered a release and should sign
# and publish the binaries.
- name: CR_RELEASE
value: $[startsWith(variables['Build.SourceBranch'], 'refs/tags/v')]
# Main Python version for building distributables.
- name: CR_PY_VERSION
value: '3.10'
# Link the group of Apple passwords from pipeline library.
- group: 'Apple IDs'

jobs:
- job: windows10
Expand Down
14 changes: 11 additions & 3 deletions cr.spec
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import platform, os

codesign_identity = None
strip = False

# If this is being run in a release pipeline, sign the executable with
# codesign_identity for macos.
import os
codesign_identity = None
if os.environ.get("CR_RELEASE", "").lower() == "true":
codesign_identity = "Developer ID Application: CodeRed LLC (26334S6DB6)"

# Apply symbol table stripping from the executable on Linux,
# to reduce file size.
if platform.system() == "Linux":
strip = True

block_cipher = None

a = Analysis(
Expand Down Expand Up @@ -38,7 +46,7 @@ exe = EXE(
icon="icon/cr.ico",
debug=False,
bootloader_ignore_signals=False,
strip=False,
strip=strip,
upx=False,
upx_exclude=[],
runtime_tmpdir=None,
Expand Down

0 comments on commit 08d7a1a

Please sign in to comment.