Skip to content

Commit fc4dfa9

Browse files
author
arch
committed
try build installer with github actions
1 parent 1c995e9 commit fc4dfa9

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Create Windows Executable using Miniconda
2+
3+
on:
4+
push:
5+
# tags:
6+
# - '*'
7+
8+
jobs:
9+
miniconda:
10+
name: Miniconda ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: ["windows-latest"]
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@v2
18+
- name: Setup Miniconda
19+
uses: conda-incubator/setup-miniconda@v2
20+
with:
21+
activate-environment: build-installer
22+
environment-file: ./contrib/Installer/environment.yaml
23+
python-version: 3.9
24+
auto-activate-base: false
25+
- name: Collect Conda Info
26+
shell: bash -l {0}
27+
run: |
28+
conda info
29+
conda env export
30+
- name: Get Application Version
31+
id: get_version
32+
uses: battila7/get-version-action@v2
33+
- name: Build Installer
34+
shell: bash -l {0}
35+
working-directory: ./contrib/Installer
36+
run: |
37+
pyinstaller --add-data="assets/*;./" --noupx --onefile mtfg-ofs-extension-installer.py
38+
- name: Create Release
39+
id: create_release
40+
uses: actions/create-release@v1
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
with:
44+
tag_name: ${{ steps.get_version.outputs.version }}
45+
release_name: ${{ steps.get_version.outputs.version }}
46+
draft: true
47+
prerelease: true
48+
- name: Upload Installer
49+
id: upload-release-asset-1
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: ./contrib/Installer/dist/mtfg-ofs-extension-installer.exe
56+
asset_name: mtfg-ofs-extension-installer.exe
57+
asset_content_type: application/octet-stream

contrib/Installer/mtfg-ofs-extension-installer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from bs4 import BeautifulSoup # beautifulsoup4
1414
from tqdm import tqdm
1515

16+
VERSION = "v0.0.1"
1617
LUA_EXTENSION_URL = "https://raw.githubusercontent.com/michael-mueller-git/Python-Funscript-Editor/main/contrib/Installer/assets/main.lua"
1718
FUNSCRIPT_GENERATOR_RELEASE_URL = "https://github.com/michael-mueller-git/Python-Funscript-Editor/releases"
1819
OFS_EXTENSION_DIR = os.path.expandvars(r'%APPDATA%\OFS\OFS_data\extensions')
@@ -106,11 +107,11 @@ def update(download_urls, latest):
106107

107108

108109
if __name__ == "__main__":
110+
print("MTFG OFS Extension Installer ", VERSION)
109111
try:
110112
if platform.system() != "Windows":
111113
error("This installer only work on Windows")
112114

113-
print("Start MTFG installation")
114115
is_ofs_installed()
115116
download_urls, latest = get_download_urls()
116117
update(download_urls, latest)

0 commit comments

Comments
 (0)