Skip to content

Commit 3758ad0

Browse files
added actions to the project
1 parent 059db11 commit 3758ad0

File tree

2 files changed

+63
-1
lines changed

2 files changed

+63
-1
lines changed

.github/build.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: windows-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: 3.x
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install -r requirements.txt
25+
pip install cxfreeze
26+
- name: Build
27+
id: build
28+
run: |
29+
python setup.py build
30+
- name: Rename build folder
31+
run: |
32+
mv build_windows auto-download-sorter
33+
- name: Zip build folder
34+
run: |
35+
7z a auto-download-sorter.zip auto-download-sorter
36+
- name: Create Release
37+
id: create_release
38+
uses: actions/create-release@v1
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
with:
42+
tag_name: "${{steps.build.outputs.version}}"
43+
release_name: Release v1.0.0
44+
body: |
45+
This is the first release of the Auto Download Sorter.
46+
draft: false
47+
prerelease: false
48+
- name: Upload Release Asset
49+
id: upload_release_asset
50+
uses: actions/upload-release-asset@v1
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
with:
54+
upload_url: ${{ steps.create_release.outputs.upload_url }}
55+
asset_path: ./auto-download-sorter.zip
56+
asset_name: auto-download-sorter.zip
57+
asset_content_type: application/zip

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
from cx_Freeze import setup, Executable
22
import sys
3+
import os
4+
version = 'v1.2.0'
35

6+
7+
os.system(f"echo '::set-output name=version::{version}'")
48
# Dependencies are automatically detected, but it might need
59
# fine tuning.
610
build_options = {'packages': ['os', 'getpass', 'library'], 'excludes': [], 'build_exe': 'build_windows',
@@ -11,8 +15,9 @@
1115
executables = [
1216
Executable('auto_download_sorter.py', base=base, target_name='Auto Download Sorter', icon='icon.ico')
1317
]
18+
1419
setup(name='Auto Download Sorter',
15-
version='1.0',
20+
version=version,
1621
description='Auto Download Sorter',
1722
options={'build_exe': build_options},
1823
executables=executables)

0 commit comments

Comments
 (0)