-
-
Notifications
You must be signed in to change notification settings - Fork 18
111 lines (107 loc) · 3.77 KB
/
build.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
name: Build
on:
workflow_dispatch:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
createrelease:
name: Create Release
runs-on: [ubuntu-latest]
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: false
- name: Output Release URL File
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt
- name: Save Release URL File for publish
uses: actions/upload-artifact@v1
with:
name: release_url
path: release_url.txt
build:
name: Build packages
needs: createrelease
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
TARGET: macos
CMD_BUILD: >
pyinstaller osx.spec &&
cd dist/ &&
zip -r9 ZigStarGW-MT.app.zip ZigStarGW-MT.app/
OUT_FILE_NAME: ZigStarGW-MT.app.zip
ASSET_MIME: application/zip
- os: windows-latest
TARGET: windows64
arch: x64
CMD_BUILD: >
COPY cc2538-bsl\cc2538-bsl.py cc2538_bsl.py /Y &&
pyinstaller -F -w -n ZigStarGW-MT -i ui/images/zigstar_tr_gl.ico --version-file ui/file_version_info.txt ZigStarGW-MT.py &&
cd dist/ &&
powershell Compress-Archive ZigStarGW-MT.exe ZigStarGW-MT-x64.exe.zip
OUT_FILE_NAME: ZigStarGW-MT-x64.exe.zip
ASSET_MIME: application/zip
- os: windows-latest
TARGET: windows32
arch: x86
CMD_BUILD: >
COPY cc2538-bsl\cc2538-bsl.py cc2538_bsl.py /Y &&
pyinstaller -F -w -n ZigStarGW-MT -i ui/images/zigstar_tr_gl.ico --version-file ui/file_version_info.txt ZigStarGW-MT.py &&
cd dist/ &&
powershell Compress-Archive ZigStarGW-MT.exe ZigStarGW-MT-x86.exe.zip
OUT_FILE_NAME: ZigStarGW-MT-x86.exe.zip
ASSET_MIME: application/zip
- os: ubuntu-latest
TARGET: ubuntu
CMD_BUILD: >
pyinstaller -F -w -n ZigStarGW-MT -i ui/images/zigstar_tr_gl.ico --version-file ui/file_version_info.txt ZigStarGW-MT.py &&
cd dist/ &&
zip -r9 ZigStarGW-MT.exec.zip ZigStarGW-MT
OUT_FILE_NAME: ZigStarGW-MT.exec.zip
ASSET_MIME: application/zip
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
architecture: ${{ matrix.arch }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install -r requirements.txt
- name: Build with pyinstaller for ${{matrix.TARGET}}
run: ${{matrix.CMD_BUILD}}
- name: Load Release URL File from release job
uses: actions/download-artifact@v1
with:
name: release_url
- name: Get Release File Name & Upload URL
id: get_release_info
shell: bash
run: |
value=`cat release_url/release_url.txt`
echo ::set-output name=upload_url::$value
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./dist/${{ matrix.OUT_FILE_NAME}}
asset_name: ${{ matrix.OUT_FILE_NAME}}
asset_content_type: ${{ matrix.ASSET_MIME}}