Skip to content

Compile and publish binaries #164

Compile and publish binaries

Compile and publish binaries #164

Workflow file for this run

name: Compile and publish binaries
on:
release:
types:
- created
- prereleased
- edited
- published
jobs:
macOS-RELEASE:
permissions: write-all
name: OSX release build
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.10.x"
- name: Update pip
run: pip3 install --upgrade pip
- name: Install dependencies
run: pip3 install -r requirements.txt
- name: Install pyinstaller
run: pip3 install pyinstaller
- name: Install create-dmg
run: brew install create-dmg
- name: Build app bundle & binaries for OSX (RELEASE VERSION)
run: pyinstaller main.py \
--onefile \
--windowed \
--name OCSysInfo \
--icon=./resources/icons/OCSI_logo_mac.icns \
--paths=./src \
--target-architecture x86_64 \
--add-data 'src/util/version.json:src/util' \
--add-data 'requirements.txt:.'
- name: Apply app bundle patch
run: |
cp ./patches/launcher.sh dist/OCSysInfo.app/Contents/MacOS/Launcher
chmod +x dist/OCSysInfo.app/Contents/MacOS/Launcher
python3 ./patches/patch_plist.py
- name: Pack app into DMG image
run: |
rm -rf dist/OCSysInfo
create-dmg \
--volname "OCSysInfo" \
--volicon "resources/icons/OCSI_logo_mac.icns" \
--window-pos 200 120 \
--icon "OCSysInfo.app" 300 202 \
--window-size 800 400 \
--app-drop-link 600 200 "ocsysinfo_osx_x86_64-RELEASE.dmg" "dist/" \
--no-internet-enable
- name: Upload to Artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts OSX
path: ocsysinfo_osx_x86_64-RELEASE.dmg
- name: Upload to Release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ocsysinfo_osx_x86_64-RELEASE.dmg
tag: ${{ github.ref }}
file_glob: true
macOS-DEBUG:
permissions: write-all
name: OSX debug build
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.10.x"
- name: Update pip
run: pip3 install --upgrade pip
- name: Install dependencies
run: pip3 install -r requirements.txt
- name: Install pyinstaller
run: pip3 install pyinstaller
- name: Install create-dmg
run: brew install create-dmg
- name: Build app bundle & binaries for OSX (DEBUG VERSION)
run: pyinstaller main.py \
--onefile \
--windowed \
--name OCSysInfo \
--icon=./resources/icons/OCSI_logo_mac.icns \
--paths=./src \
--target-architecture x86_64 \
--add-data 'src/util/version.json:src/util' \
--add-data 'requirements.txt:.' \
--runtime-hook exe_dbg_hook.py
- name: Apply app bundle patch
run: |
cp ./patches/launcher.sh dist/OCSysInfo.app/Contents/MacOS/Launcher
chmod +x dist/OCSysInfo.app/Contents/MacOS/Launcher
python3 ./patches/patch_plist.py
- name: Pack app into DMG image
run: |
rm -rf dist/OCSysInfo
create-dmg \
--volname "OCSysInfo" \
--volicon "resources/icons/OCSI_logo_mac.icns" \
--window-pos 200 120 \
--icon "OCSysInfo.app" 300 202 \
--window-size 800 400 \
--app-drop-link 600 200 "ocsysinfo_osx_x86_64-DEBUG.dmg" "dist/" \
--no-internet-enable
- name: Upload to Artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts OSX
path: ocsysinfo_osx_x86_64-DEBUG.dmg
- name: Upload to Release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ocsysinfo_osx_x86_64-DEBUG.dmg
tag: ${{ github.ref }}
file_glob: true
windows-RELEASE:
permissions: write-all
name: Windows release binaries
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.10.x"
- name: Upgrade pip
# `--user` flag provided just in case of a permissions conflict.
run: pip3 install --upgrade pip --user
- 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_x86_64-RELEASE \
--paths=./src \
--icon=./resources/icons/OCSI_logo_win.ico \
--add-data 'src/util/version.json:src/util' \
--add-data 'requirements.txt:.'
- 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
windows-DEBUG:
permissions: write-all
name: Windows debug binaries
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.10.x"
- name: Upgrade pip
# `--user` flag provided just in case of a permissions conflict.
run: pip3 install --upgrade pip --user
- 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_x86_64-DEBUG \
--paths=./src \
--icon=./resources/icons/OCSI_logo_win.ico \
--add-data 'src/util/version.json:src/util' \
--add-data 'requirements.txt:.' \
--runtime-hook exe_dbg_hook.py
- 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-RELEASE:
permissions: write-all
name: Linux x86_64 release binaries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.10.x"
- name: Update pip (just in case)
run: pip3 install --upgrade 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-RELEASE \
--paths=./src \
--add-data 'src/util/version.json:src/util' \
--add-data 'requirements.txt:.'
- name: Upload to Artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts Linux
path: dist/ocsysinfo_linux_x86_64-RELEASE
- 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-RELEASE
tag: ${{ github.ref }}
file_glob: true
linux_x64-DEBUG:
permissions: write-all
name: Linux x86_64 debug binaries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.10.x"
- name: Update pip (just in case)
run: pip3 install --upgrade 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-DEBUG \
--paths=./src \
--add-data 'src/util/version.json:src/util' \
--add-data 'requirements.txt:.' \
--runtime-hook exe_dbg_hook.py
- name: Upload to Artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts Linux
path: dist/ocsysinfo_linux_x86_64-DEBUG
- 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-DEBUG
tag: ${{ github.ref }}
file_glob: true