Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Unified action #19

Merged
merged 7 commits into from
Dec 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 170 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
name: Release Build for TimerX

on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
default: '1.0'


jobs:

# UBUNTU BUILD
build-ubuntu:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install Python
uses: actions/setup-python@v1
with:
python-version: '3.8'
architecture: 'x64'
- name: Install requirements
run: |
pip install -r requirements.txt
pip install -r packager-requirements.txt

- name: Run cx_freeze
continue-on-error: true
run: |
python setup.py bdist_rpm

- name: Run alien
continue-on-error: true
run: |
cd dist
sudo apt install alien
sudo alien -d TimerX-${{ github.event.inputs.version }}.tar.gz --version=${{ github.event.inputs.version }}
sudo alien -r TimerX-${{ github.event.inputs.version }}.tar.gz --version=${{ github.event.inputs.version }}
- uses: actions/upload-artifact@v2
with:
name: TimerX.deb
path: dist/timerx_${{ github.event.inputs.version }}-2_all.deb
- uses: actions/upload-artifact@v2
with:
name: TimerX.rpm
path: dist/TimerX-${{ github.event.inputs.version }}-2.noarch.rpm
- uses: actions/upload-artifact@v2
with:
name: TimerX.tar.gz
path: dist/TimerX-${{ github.event.inputs.version }}.tar.gz

# WINDOWS BUILD
build-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install Python
uses: actions/setup-python@v1
with:
python-version: '3.10'
architecture: 'x64'
- name: Install requirements
run: |
pip install -r requirements.txt
pip install -r windows-requirements.txt
pip install -r packager-requirements.txt
- name: Run cx_freeze
run: |
python setup.py bdist_msi
- uses: actions/upload-artifact@v2
with:
name: TimerX-setup.msi
path: dist/TimerX-win64.msi

# MACOS BUILD
build-macos:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install Python
uses: actions/setup-python@v1
with:
python-version: '3.10'
architecture: 'x64'
- name: Install requirements
run: |
pip install -r requirements.txt
pip install -r packager-requirements.txt
- name: Run cx_freeze
run: |
python setup.py bdist_dmg
- uses: actions/upload-artifact@v2
with:
name: TimerX-setup.dmg
path: build/TimerX.dmg

#RELEASE
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: 'Release ${{ github.event.inputs.version }}'
overwrite: true
body: |
Release ${{ github.event.inputs.version }} (Add your content here and then publish this.)
draft: true
prerelease: false

- name: Upload Release Asset(DEB)
id: upload-release-asset-deb
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{steps.create_release.outputs.upload_url}}
asset_path: dist/timerx_${{ github.event.inputs.version }}-2_all.deb
asset_name: TimerX.deb
asset_content_type: application/zip

- name: Upload Release Asset(Tarball)
id: upload-release-asset-tar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{steps.create_release.outputs.upload_url}}
asset_path: dist/TimerX-${{ github.event.inputs.version }}.tar.gz
asset_name: TimerX.tar.gz
asset_content_type: application/zip

- name: Upload Release Asset(RPM)
id: upload-release-asset-rpm
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{steps.create_release.outputs.upload_url}}
asset_path: dist/TimerX-${{ github.event.inputs.version }}-2.noarch.rpm
asset_name: TimerX.rpm
asset_content_type: application/zip

- name: Upload Release Asset(EXE)
id: upload-release-asset-rpm
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{steps.create_release.outputs.upload_url}}
asset_path: dist/TimerX-win64.msi
asset_name: TimerX-setup.msi
asset_content_type: application/zip

- name: Upload Release Asset(DMG)
id: upload-release-asset-rpm
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{steps.create_release.outputs.upload_url}}
asset_path: build/TimerX.dmg
asset_name: TimerX-setup.dmg
asset_content_type: application/zip
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
app_on = True

timer_on = False
timer_paused = True
timer_paused = False

timer_seconds = 5
timer_minutes = 0
Expand Down
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
if sys.platform == "win32":
base = "Win32GUI"
icon="./assets/logo.ico"
executables = [Executable("main.py", base=base, icon=icon, shortcut_name="TimerX", target_name="TimerX.exe", shortcutDir="%appdata%\Microsoft\Windows\Start Menu\Programs\TimerX")]
elif sys.platform == "darwin":
icon="./assets/logo.icns"
executables = [Executable("main.py", base=base, icon=icon, shortcut_name="TimerX", target_name="TimerX.exe")]
else:
icon="./assets/logo.png"
executables = [Executable("main.py", base=base, icon=icon, shortcut_name="TimerX", target_name="TimerX.exe")]

# directory_table = [
# ("ProgramMenuFolder", "TARGETDIR", "."),
Expand All @@ -28,10 +31,6 @@
upgradeid = str(uuid.uuid3(uuid.NAMESPACE_DNS, 'TimerX.TimerX.org')).upper()
# print(str(uuid.uuid3(uuid.NAMESPACE_DNS, 'TimerX.TimerX.org')).upper())

# executables = [Executable("main.py", base=base, icon=icon, shortcut_name="TimerX", shortcut_dir="TimerX")]
executables = [Executable("main.py", base=base, icon=icon, shortcut_name="TimerX", target_name="TimerX")]


# build_exe_options = {"includes": ["tkinter, platform, threading"], "include_msvcr": True}
build_exe_options = {
"include_msvcr": True,
Expand Down