forked from pulkin/micropython
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazure-pipelines.yml
137 lines (111 loc) · 4.52 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
variables:
GITHUB_OAUTH_CONNECTION_NAME: 'github-pulkin'
GITHUB_MICROPY_REPO: 'pulkin/micropython'
GITHUB_RELEASE_TAG: 'latest-build'
MAKEOPTS: "-j4"
stages:
- stage: build
displayName: 'Test and build'
jobs:
- job: port_esp8266
displayName: 'esp8266 port build'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: |
sudo apt-get install python-pip python3-pip
sudo pip3 install pyparsing
sudo pip install pyserial
wget https://github.com/jepler/esp-open-sdk/releases/download/2018-06-10/xtensa-lx106-elf-standalone.tar.gz
zcat xtensa-lx106-elf-standalone.tar.gz | tar x
displayName: 'Install dependencies and toolchain'
- script: |
export PATH=$(pwd)/xtensa-lx106-elf/bin:$PATH
make ${MAKEOPTS} -C mpy-cross
make ${MAKEOPTS} -C ports/esp8266 submodules
make ${MAKEOPTS} -C ports/esp8266
displayName: 'Build'
- script: |
cd ports/esp8266/build-GENERIC
find . \! -name '*.bin' -delete
cd -
displayName: 'Cleanup build before publishing'
- task: PublishPipelineArtifact@1
displayName: 'Collect the build'
inputs:
targetPath: '$(Build.Repository.LocalPath)/ports/esp8266/build-GENERIC'
artifact: 'build_esp8266'
- job: port_gprs_a9
displayName: 'gprs_a9 build'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: git submodule update --init --recursive lib/axtls lib/GPRS_C_SDK lib/csdtk42-linux
displayName: 'Checkout submodules'
- script: |
sudo apt-get update
sudo apt-get install build-essential gcc-multilib g++-multilib libzip-dev zlib1g lib32z1 python3
displayName: 'Install dependencies'
- script: |
make ${MAKEOPTS} -C mpy-cross
cd ports/gprs_a9
make
displayName: 'Build'
- task: PublishPipelineArtifact@1
displayName: 'Collect the build'
inputs:
targetPath: '$(Build.Repository.LocalPath)/ports/gprs_a9/hex'
artifact: 'build_gprs_a9'
- stage: publish
displayName: 'Publish builds'
dependsOn: build
jobs:
- job: publish
displayName: 'Download and publish builds'
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download all builds'
inputs:
buildType: 'current'
targetPath: '$(Build.BinariesDirectory)'
- script: |
mv $(Build.BinariesDirectory)/build_gprs_a9/*.lod $(Build.BinariesDirectory)
rm -rf $(Build.BinariesDirectory)/build_gprs_a9
mv $(Build.BinariesDirectory)/build_esp8266/*.bin $(Build.BinariesDirectory)
rm -rf $(Build.BinariesDirectory)/build_esp8266
mv $(Build.BinariesDirectory)/build_unix/micropython $(Build.BinariesDirectory)
rm -rf $(Build.BinariesDirectory)/build_unix
displayName: 'Sort and filter binaries'
- task: GitHubRelease@0
displayName: 'Publish on Github releases'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
gitHubConnection: $(GITHUB_OAUTH_CONNECTION_NAME)
repositoryName: $(GITHUB_MICROPY_REPO)
action: 'edit'
target: '$(Build.SourceVersion)'
tag: $(GITHUB_RELEASE_TAG)
title: 'Latest master build'
releaseNotesSource: 'input'
releaseNotes: |
The latest successful `master` build.
Updated: $(Year:yy)-$(Month)-$(DayOfMonth) $(Hours):$(Minutes):$(Seconds)
Firmware files
--------------
- **unix**
- [micropython](https://github.com/$(GITHUB_MICROPY_REPO)/releases/download/$(GITHUB_RELEASE_TAG)/micropython)
- **gprs_a9**
Burn instructions: use [cooltools](https://ai-thinker-open.github.io/GPRS_C_SDK_DOC/en/c-sdk/burn-debug.html)
Firmware files:
- [firmware_debug_full.lod](https://github.com/$(GITHUB_MICROPY_REPO)/releases/download/$(GITHUB_RELEASE_TAG)/firmware_debug_full.lod)
- [firmware_debug_flash.lod](https://github.com/$(GITHUB_MICROPY_REPO)/releases/download/$(GITHUB_RELEASE_TAG)/firmware_debug_flash.lod)
- **esp8266**
Burn instructions: use [esptool](https://github.com/espressif/esptool)
Firmware files:
- [firmware_combined.bin](https://github.com/$(GITHUB_MICROPY_REPO)/releases/download/$(GITHUB_RELEASE_TAG)/firmware-combined.bin)
assets: '$(Build.BinariesDirectory)/*'
assetUploadMode: 'replace'
isPreRelease: true
addChangeLog: false