2020-05-16 13:05:02 +03:00
|
|
|
# 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:
|
2020-05-20 10:41:10 +03:00
|
|
|
- "*"
|
2020-06-16 00:14:05 +03:00
|
|
|
tags:
|
|
|
|
include:
|
|
|
|
- "*"
|
2020-05-16 13:05:02 +03:00
|
|
|
|
|
|
|
pool:
|
2020-12-24 12:43:36 +03:00
|
|
|
vmImage: "macOS-10.15"
|
2020-05-16 13:05:02 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-05-24 02:20:58 +03:00
|
|
|
Mojave DMG:
|
2021-03-16 01:42:31 +03:00
|
|
|
python.version: "3.9"
|
2020-05-16 13:05:02 +03:00
|
|
|
|
2020-12-24 12:43:36 +03:00
|
|
|
variables:
|
|
|
|
- group: Apple-Notarize-Variables
|
2021-06-15 19:55:08 +03:00
|
|
|
- group: AWS-Upload-Credentials
|
2020-12-24 12:43:36 +03:00
|
|
|
|
2020-05-16 13:05:02 +03:00
|
|
|
steps:
|
2021-04-05 06:51:11 +03:00
|
|
|
- checkout: self # self represents the repo where the initial Azure Pipelines YAML file was found
|
|
|
|
submodules: recursive
|
|
|
|
fetchDepth: 0
|
|
|
|
displayName: "Checkout code"
|
|
|
|
|
2020-05-20 10:41:10 +03:00
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: "$(python.version)"
|
|
|
|
displayName: "Use Python $(python.version)"
|
2020-05-16 13:05:02 +03:00
|
|
|
|
2020-06-08 10:14:44 +03:00
|
|
|
# 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
|
|
|
|
|
2020-05-20 10:41:10 +03:00
|
|
|
- script: |
|
2020-05-24 01:47:01 +03:00
|
|
|
python -m venv venv
|
|
|
|
ln -s venv/bin/activate .
|
|
|
|
. ./activate
|
2020-05-20 10:41:10 +03:00
|
|
|
python -m pip install --upgrade pip
|
2020-06-07 02:18:43 +03:00
|
|
|
pip install wheel pep517 setuptools_scm
|
2020-05-20 10:41:10 +03:00
|
|
|
node -v
|
2021-06-14 18:21:12 +03:00
|
|
|
pip install -i https://pypi.chia.net/simple/ miniupnpc==2.2.2
|
2021-06-15 19:55:08 +03:00
|
|
|
cd build_scripts
|
|
|
|
touch $(System.DefaultWorkingDirectory)/build_scripts/version.txt
|
|
|
|
python -m installer-version > $(System.DefaultWorkingDirectory)/build_scripts/version.txt
|
2020-05-20 10:41:10 +03:00
|
|
|
displayName: "Install dependencies"
|
2020-05-16 13:05:02 +03:00
|
|
|
|
2020-05-20 10:41:10 +03:00
|
|
|
- script: |
|
2020-05-24 01:47:01 +03:00
|
|
|
. ./activate
|
2020-10-01 07:04:17 +03:00
|
|
|
clang --version
|
2021-03-09 02:06:58 +03:00
|
|
|
pip wheel --use-pep517 --extra-index-url https://pypi.chia.net/simple/ --wheel-dir=wheels .
|
2020-11-10 13:46:01 +03:00
|
|
|
pip install --no-index --find-links=./wheels/ chia-blockchain
|
|
|
|
displayName: "Build and install wheels"
|
2020-05-16 13:05:02 +03:00
|
|
|
|
2020-05-31 12:09:53 +03:00
|
|
|
- task: NodeTool@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: '12.x'
|
2020-06-05 07:45:30 +03:00
|
|
|
displayName: "Setup Node 12.x"
|
2020-05-31 12:09:53 +03:00
|
|
|
|
2020-12-24 12:43:36 +03:00
|
|
|
- bash: |
|
2020-05-24 01:47:01 +03:00
|
|
|
. ./activate
|
2021-01-18 07:06:17 +03:00
|
|
|
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
|
2021-03-13 02:19:33 +03:00
|
|
|
git submodule update --init --recursive
|
2021-01-18 07:06:17 +03:00
|
|
|
cd build_scripts || exit
|
2020-05-23 23:41:19 +03:00
|
|
|
sh build_macos.sh
|
2020-05-24 01:47:01 +03:00
|
|
|
displayName: "Build DMG with build_scripts/build_macos.sh"
|
2020-05-22 02:10:02 +03:00
|
|
|
|
2020-05-20 10:41:10 +03:00
|
|
|
- task: PublishPipelineArtifact@1
|
|
|
|
inputs:
|
|
|
|
targetPath: $(System.DefaultWorkingDirectory)/wheels
|
|
|
|
artifactName: MacOS-wheels
|
|
|
|
displayName: "Upload MacOS wheels"
|
2020-05-22 02:10:02 +03:00
|
|
|
|
|
|
|
- task: PublishPipelineArtifact@1
|
|
|
|
inputs:
|
2020-06-07 02:18:43 +03:00
|
|
|
targetPath: $(System.DefaultWorkingDirectory)/build_scripts/final_installer/
|
2020-05-22 02:10:02 +03:00
|
|
|
artifactName: MacOS-DMG
|
|
|
|
displayName: "Upload MacOS DMG"
|
2021-06-15 19:55:08 +03:00
|
|
|
|
|
|
|
- bash: |
|
|
|
|
ls $(System.DefaultWorkingDirectory)/build_scripts/
|
|
|
|
cat $(System.DefaultWorkingDirectory)/build_scripts/version.txt
|
|
|
|
displayName: "list files in dir"
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
ls $(System.DefaultWorkingDirectory)/build_scripts/final_installer/
|
|
|
|
cd $(System.DefaultWorkingDirectory)/build_scripts/
|
|
|
|
export CHIA_VERSION="Chia-"$(<version.txt)
|
2021-06-16 00:23:25 +03:00
|
|
|
shasum -a 256 $(System.DefaultWorkingDirectory)/build_scripts/final_installer/$CHIA_VERSION.dmg > $(System.DefaultWorkingDirectory)/build_scripts/final_installer/$CHIA_VERSION.dmg.sha256
|
2021-06-15 19:55:08 +03:00
|
|
|
ls $(System.DefaultWorkingDirectory)/build_scripts/final_installer/
|
|
|
|
displayName: "Create Checksums"
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
export AWS_ACCESS_KEY_ID=$(AccessKey)
|
|
|
|
export AWS_SECRET_ACCESS_KEY=$(SecretKey)
|
|
|
|
export AWS_DEFAULT_REGION=us-west-2
|
|
|
|
aws s3 cp $(System.DefaultWorkingDirectory)/build_scripts/final_installer/*.dmg s3://download-chia-net/builds/
|
|
|
|
displayName: "Upload to S3"
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
export AWS_ACCESS_KEY_ID=$(AccessKey)
|
|
|
|
export AWS_SECRET_ACCESS_KEY=$(SecretKey)
|
|
|
|
export AWS_DEFAULT_REGION=us-west-2
|
|
|
|
aws s3 cp $(System.DefaultWorkingDirectory)/build_scripts/final_installer/$CHIA_VERSION.dmg s3://download-chia-net/install/
|
2021-06-16 00:23:25 +03:00
|
|
|
aws s3 cp $(System.DefaultWorkingDirectory)/build_scripts/final_installer/$CHIA_VERSION.dmg.sha256 s3://download-chia-net/install/
|
2021-06-15 19:55:08 +03:00
|
|
|
displayName: "Upload Release Files"
|
|
|
|
condition: contains(variables['build.sourceBranch'], 'refs/tags/')
|