chia-blockchain/azure-pipelines.yml

89 lines
2.5 KiB
YAML

# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
trigger:
branches:
include:
- "*"
tags:
include:
- "*"
pool:
vmImage: "macOS-10.15"
strategy:
matrix:
Mojave DMG:
python.version: "3.9"
variables:
- group: Apple-Notarize-Variables
steps:
- checkout: self # self represents the repo where the initial Azure Pipelines YAML file was found
submodules: recursive
fetchDepth: 0
displayName: "Checkout code"
- task: UsePythonVersion@0
inputs:
versionSpec: "$(python.version)"
displayName: "Use Python $(python.version)"
# Install Apple certificate
# Install an Apple certificate required to build on a macOS agent machine
- task: InstallAppleCertificate@2
inputs:
certSecureFile: 'chia-apple-dev-id-app.p12'
certPwd: $(CHIA_APPLE_DEV_ID_APP_PASS)
keychain: temp
deleteCert: true
- script: |
python -m venv venv
ln -s venv/bin/activate .
. ./activate
python -m pip install --upgrade pip
pip install wheel pep517 setuptools_scm
node -v
pip install -i https://pypi.chia.net/simple/ miniupnpc==2.1
displayName: "Install dependencies"
- script: |
. ./activate
clang --version
pip wheel --use-pep517 --extra-index-url https://pypi.chia.net/simple/ --wheel-dir=wheels .
pip install --no-index --find-links=./wheels/ chia-blockchain
displayName: "Build and install wheels"
- task: NodeTool@0
inputs:
versionSpec: '12.x'
displayName: "Setup Node 12.x"
- bash: |
. ./activate
APPLE_NOTARIZE_USERNAME="$(APPLE_NOTARIZE_USERNAME)"
export APPLE_NOTARIZE_USERNAME
APPLE_NOTARIZE_PASSWORD="$(APPLE_NOTARIZE_PASSWORD)"
export APPLE_NOTARIZE_PASSWORD
if [ "$(APPLE_NOTARIZE_PASSWORD)" ]; then NOTARIZE="true"; export NOTARIZE; fi
git submodule update --init --recursive
cd build_scripts || exit
sh build_macos.sh
displayName: "Build DMG with build_scripts/build_macos.sh"
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(System.DefaultWorkingDirectory)/wheels
artifactName: MacOS-wheels
displayName: "Upload MacOS wheels"
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(System.DefaultWorkingDirectory)/build_scripts/final_installer/
artifactName: MacOS-DMG
displayName: "Upload MacOS DMG"