Skip to content

Commit

Permalink
add workflow, hopefully fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kernel-dev committed Mar 19, 2022
1 parent a0667d8 commit 50b802a
Showing 1 changed file with 113 additions and 0 deletions.
113 changes: 113 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Compile and publish binaries

on:
release:
types: [published]

jobs:
macOS:
name: Build OSX binaries
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
ref: releases-source

- name: Set up Python 3
run: brew install python3

- name: Install dependencies
run: pip3 install -r requirements.txt

- name: Install pyinstaller
run: pip3 install pyinstaller

- name: Build binaries for OSX
run: pyinstaller main.py --onefile --name ocsysinfo_osx_x86_64 --paths=./src --target-architecture x86_64

- name: Upload to Artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts OSX
path: dist/ocsysinfo_osx_x86_64

- name: Upload to Release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/ocsysinfo_osx_*
tag: ${{ github.ref }}
file_glob: true

windows:
name: Build Windows binaries
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
ref: releases-source

- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.x"

- name: Install dependencies
run: pip3 install -r requirements.txt

- name: Install pyinstaller
run: pip3 install pyinstaller

- name: Build binaries for Windows
run: pyinstaller main.py --onefile --name ocsysinfo_win --paths=./src

- name: Upload to Artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts Windows
path: dist/ocsysinfo_win*

- name: Upload to Release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/ocsysinfo_win*
tag: ${{ github.ref }}
file_glob: true

linux_x64:
name: Build Linux x86_64 binaries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: releases-source

- name: Install python3 and pip3
run: sudo apt-get install python3 python3-pip

- name: Install dependencies
run: pip3 install -r requirements.txt

- name: Install pyinstaller
run: pip3 install pyinstaller

- name: Build binaries for Linux, x86_64 architecture
run: pyinstaller main.py --onefile --name ocsysinfo_linux_x86_64 --paths=./src

- name: Upload to Artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts Linux ARM64
path: dist/ocsysinfo_linux_x86_64

- name: Upload to Release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/ocsysinfo_linux_x86_64
tag: ${{ github.ref }}
file_glob: true

0 comments on commit 50b802a

Please sign in to comment.