-
Notifications
You must be signed in to change notification settings - Fork 1
109 lines (107 loc) · 3.6 KB
/
release.yaml
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
name: IoMBian Discover Release
on:
push:
tags:
- 'v*'
jobs:
create_release:
name: IoMBian Discover Create Release
runs-on: [ubuntu-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: IoMBian Discover ${{ github.ref }}
draft: false
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_and_upload_nix:
name: IoMBian Discover Build and Upload (*nix)
strategy:
matrix:
platform: [ubuntu-18.04, ubuntu-20.04, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.6
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build with pyinstaller
run: |
pyinstaller --name iombian-discover -w -F src/main.py
- name: Load Release URL File
uses: actions/download-artifact@v1
with:
name: release_url
- name: Get Release File Name & Upload URL
id: get_release_info
run: |
value=`cat release_url/release_url.txt`
echo ::set-output name=upload_url::$value
- name: Upload Release Asset (*nix)
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/iombian-discover
asset_name: iombian-discover-${{ matrix.platform }}
asset_content_type: application/octet-stream
build_and_upload_windows:
name: IoMBian Discover Build and Upload (Windows)
strategy:
matrix:
platform: [windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.6
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build with pyinstaller
run: |
pyinstaller --name iombian-discover --icon=resources/search.ico -w -F src/main.py
- name: Load Release URL File
uses: actions/download-artifact@v1
with:
name: release_url
- name: Get Release File Name & Upload URL
id: get_release_info
run: |
Set-Variable -Name value -Value (cat release_url\release_url.txt)
echo "::set-output name=upload_url::$value"
- name: Upload Release Asset (Windows)
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/iombian-discover.exe
asset_name: iombian-discover-${{ matrix.platform }}.exe
asset_content_type: application/octet-stream