forked from xyzz/womier-flasher
-
Notifications
You must be signed in to change notification settings - Fork 32
127 lines (113 loc) · 4.2 KB
/
upload_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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Upload Release Asset
jobs:
create-release-tag:
name: Create The Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
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: Release ${{ github.ref }}
draft: false
prerelease: false
build-linux:
runs-on: ubuntu-18.04
needs: create-release-tag
steps:
- name: Install dependencies
run: sudo apt-get install libusb-1.0-0-dev libudev-dev
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.6.x'
- name: Setup venv
run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade setuptools
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build
run: |
source venv/bin/activate
fbs freeze
cd target
tar cfJ flasher-linux.tar.xz "Sonix Keyboard Flasher"
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release-tag.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: target/flasher-linux.tar.xz
asset_name: flasher-linux.tar.xz
asset_content_type: application/zip
build-mac:
runs-on: macos-10.15
needs: create-release-tag
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.6.x'
- name: Setup venv
run: |
python -m venv venv
source venv/bin/activate
pip install cython
pip install -r requirements.txt
- name: Build
run: |
source venv/bin/activate
fbs freeze
hdiutil create -volname "Sonix Keyboard Flasher" -srcfolder "target/Sonix Keyboard Flasher.app" -ov -format UDZO flasher-mac.dmg
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release-tag.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: flasher-mac.dmg
asset_name: flasher-mac.dmg
asset_content_type: application/zip
build-win:
runs-on: windows-2019
needs: create-release-tag
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.6.x'
- name: Setup venv
run: |
python -m venv venv
. .\venv\Scripts\activate.ps1
pip install -r requirements.txt
- name: Build
run: |
. .\venv\Scripts\activate.ps1
fbs freeze
Compress-Archive -Path "target\Sonix Keyboard Flasher" -DestinationPath flasher-win.zip
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release-tag.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: flasher-win.zip
asset_name: flasher-win.zip
asset_content_type: application/zip