-
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (87 loc) · 3.43 KB
/
release.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
name: Release
env:
DIST_DIR: dist
# AWS_PLUGIN_TARGET: #TODO
ARTIFACT_NAME: dist
# See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python
PYTHON_VERSION: "3.7"
on:
push:
# tags:
# - "[0-9]+.[0-9]+.[0-9]+*" # enable it at the end of developement
jobs:
build:
strategy:
fail-fast: false #TODO remove, here only 4 developement
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
python_arch: [x64]
include:
- os: windows-latest
package_platform: Windows_32bit
python_arch: x86
- os: windows-latest
package_platform: Windows_64bit
- os: ubuntu-latest
package_platform: Linux_64bit
archive_util: tar
- os: macos-latest
package_platform: macOS_64bit
archive_util: gtar # https://github.com/actions/virtual-environments/issues/2619
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
steps:
- name: Checkout mcuboot repository
uses: actions/checkout@v2
with:
repository: mcu-tools/mcuboot
path: mcuboot
ref: v1.8.0 # the patches apply only to this version
- name: Checkout imgtool-packing repository
uses: actions/checkout@v2
with:
path: imgtool-packing
- name: Apply patches
working-directory: ${{ github.workspace }}/mcuboot/scripts/
run: git apply -v ../../imgtool-packing/patches/* #apparently windows does not expand correclty ${{ github.workspace }} for some obscure reason
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: ${{ matrix.python_arch }}
- name: Upgrade PIP
run: python -m pip install --upgrade pip setuptools wheel
# - name: Display Python version
# run: python --version
- name: Display PIP version
run: pip --version
- name: Install python dependencies
working-directory: ${{ github.workspace }}/mcuboot/scripts/
run: pip install -r requirements.txt
- name: Install pyinstaller
run: pip install pyinstaller
# - name: Display Pyinstaller version
# run: pyinstaller --version
- name: Build & Package
if: matrix.os == 'windows-latest'
working-directory: ${{ github.workspace }}/mcuboot/scripts/imgtool
run: |
pyinstaller --onefile main.py -n imgtool.exe
cd ${{ env.DIST_DIR }}
7z a imgtool_0.0.1_${{ matrix.package_platform }}.zip imgtool.exe ../../../../imgtool-packing/LICENSE.txt #apparently windows does not expand correclty ${{ github.workspace }} for some obscure reason
- name: Build & Package
if: matrix.os != 'windows-latest'
working-directory: ${{ github.workspace }}/mcuboot/scripts/imgtool
run: |
pyinstaller --onefile main.py -n imgtool
cd ${{ env.DIST_DIR }}
${{ matrix.archive_util }} -cz -C ./ imgtool -C ${{ github.workspace }}/imgtool-packing/ LICENSE.txt -f imgtool_0.0.1_${{ matrix.package_platform }}.tar.gz
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
if-no-files-found: error
name: ${{ env.ARTIFACT_NAME }}
path: mcuboot/scripts/imgtool/dist/imgtool_*
# NOTARIZATION & RELEASE