Skip to content

Commit 50b802a

Browse files
committed
add workflow, hopefully fix issue
1 parent a0667d8 commit 50b802a

1 file changed

Lines changed: 113 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Compile and publish binaries
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
macOS:
9+
name: Build OSX binaries
10+
runs-on: macos-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
ref: releases-source
15+
16+
- name: Set up Python 3
17+
run: brew install python3
18+
19+
- name: Install dependencies
20+
run: pip3 install -r requirements.txt
21+
22+
- name: Install pyinstaller
23+
run: pip3 install pyinstaller
24+
25+
- name: Build binaries for OSX
26+
run: pyinstaller main.py --onefile --name ocsysinfo_osx_x86_64 --paths=./src --target-architecture x86_64
27+
28+
- name: Upload to Artifacts
29+
uses: actions/upload-artifact@v2
30+
with:
31+
name: Artifacts OSX
32+
path: dist/ocsysinfo_osx_x86_64
33+
34+
- name: Upload to Release
35+
if: github.event_name == 'release'
36+
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
37+
with:
38+
repo_token: ${{ secrets.GITHUB_TOKEN }}
39+
file: dist/ocsysinfo_osx_*
40+
tag: ${{ github.ref }}
41+
file_glob: true
42+
43+
windows:
44+
name: Build Windows binaries
45+
runs-on: windows-latest
46+
steps:
47+
- uses: actions/checkout@v3
48+
with:
49+
ref: releases-source
50+
51+
- name: Set up Python 3
52+
uses: actions/setup-python@v2
53+
with:
54+
python-version: "3.x"
55+
56+
- name: Install dependencies
57+
run: pip3 install -r requirements.txt
58+
59+
- name: Install pyinstaller
60+
run: pip3 install pyinstaller
61+
62+
- name: Build binaries for Windows
63+
run: pyinstaller main.py --onefile --name ocsysinfo_win --paths=./src
64+
65+
- name: Upload to Artifacts
66+
uses: actions/upload-artifact@v2
67+
with:
68+
name: Artifacts Windows
69+
path: dist/ocsysinfo_win*
70+
71+
- name: Upload to Release
72+
if: github.event_name == 'release'
73+
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
74+
with:
75+
repo_token: ${{ secrets.GITHUB_TOKEN }}
76+
file: dist/ocsysinfo_win*
77+
tag: ${{ github.ref }}
78+
file_glob: true
79+
80+
linux_x64:
81+
name: Build Linux x86_64 binaries
82+
runs-on: ubuntu-latest
83+
steps:
84+
- uses: actions/checkout@v3
85+
with:
86+
ref: releases-source
87+
88+
- name: Install python3 and pip3
89+
run: sudo apt-get install python3 python3-pip
90+
91+
- name: Install dependencies
92+
run: pip3 install -r requirements.txt
93+
94+
- name: Install pyinstaller
95+
run: pip3 install pyinstaller
96+
97+
- name: Build binaries for Linux, x86_64 architecture
98+
run: pyinstaller main.py --onefile --name ocsysinfo_linux_x86_64 --paths=./src
99+
100+
- name: Upload to Artifacts
101+
uses: actions/upload-artifact@v2
102+
with:
103+
name: Artifacts Linux ARM64
104+
path: dist/ocsysinfo_linux_x86_64
105+
106+
- name: Upload to Release
107+
if: github.event_name == 'release'
108+
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
109+
with:
110+
repo_token: ${{ secrets.GITHUB_TOKEN }}
111+
file: dist/ocsysinfo_linux_x86_64
112+
tag: ${{ github.ref }}
113+
file_glob: true

0 commit comments

Comments
 (0)