mirror of
https://github.com/infeeeee/dyn2py
synced 2025-12-16 22:16:18 +01:00
Windows installer, reorganize workflows
This commit is contained in:
28
.github/workflows/build-exe.yml
vendored
Normal file
28
.github/workflows/build-exe.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
name: Workflow - Build exe
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-latest
|
||||||
|
name: Build Windows exe
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
name: Checkout
|
||||||
|
- uses: actions/setup-python@v4
|
||||||
|
name: Setup Python
|
||||||
|
with:
|
||||||
|
python-version: ${{ vars.PYTHON_VERSION}}
|
||||||
|
- name: Install deps
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install .[build]
|
||||||
|
- name: Build
|
||||||
|
run: pyinstaller dyn2py.spec
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
name: Upload artifact
|
||||||
|
with:
|
||||||
|
name: dyn2py.exe
|
||||||
|
path: dist/dyn2py.exe
|
||||||
35
.github/workflows/build-installer.yml
vendored
Normal file
35
.github/workflows/build-installer.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
name: Workflow - Build installer
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-installer:
|
||||||
|
runs-on: windows-latest
|
||||||
|
name: Build Windows installer
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
name: Checkout
|
||||||
|
- name: Install Inno Setup
|
||||||
|
run: |
|
||||||
|
Invoke-WebRequest -Uri https://jrsoftware.org/download.php/is.exe -OutFile is.exe
|
||||||
|
.\is.exe /verysilent
|
||||||
|
- name: Download artifact
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: dyn2py.exe
|
||||||
|
path: dist/dyn2py.exe
|
||||||
|
- name: Update version number
|
||||||
|
run: |
|
||||||
|
$regex = Select-String -Path pyproject.toml -Pattern '^version = "((?:\d\.){2}\d)"$'
|
||||||
|
$version = $regex.Matches.Groups[1].Value
|
||||||
|
(Get-Content dyn2py-installer.iss).Replace("x.x.x",$version) | Set-Content dyn2py-installer.iss
|
||||||
|
- name: Build installer
|
||||||
|
run: |
|
||||||
|
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" -Qp $(Join-Path $PWD.Path dyn2py-installer.iss)
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
name: Upload artifact
|
||||||
|
with:
|
||||||
|
name: dyn2py-installer.exe
|
||||||
|
path: Output/dyn2py-installer.exe
|
||||||
49
.github/workflows/release.yml
vendored
49
.github/workflows/release.yml
vendored
@@ -10,39 +10,29 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
name: Test
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest]
|
os: [ubuntu-latest, windows-latest]
|
||||||
uses: ./.github/workflows/test.yml
|
uses: ./.github/workflows/test.yml
|
||||||
with:
|
with:
|
||||||
python-version: ${{ vars.PYTHON_VERSION}}
|
python-version: ${{ vars.PYTHON_VERSION }}
|
||||||
os: ${{ matrix.os }}
|
os: ${{ matrix.os }}
|
||||||
|
|
||||||
build:
|
build-exe:
|
||||||
runs-on: windows-latest
|
name: Build Windows exe
|
||||||
needs: test
|
needs: test
|
||||||
steps:
|
uses: ./.github/workflows/build-exe.yml
|
||||||
- uses: actions/checkout@v3
|
|
||||||
name: Checkout
|
build-installer:
|
||||||
- uses: actions/setup-python@v4
|
name: Build Windows installer
|
||||||
name: Setup Python
|
needs: build-exe
|
||||||
with:
|
uses: ./.github/workflows/build-installer.yml
|
||||||
python-version: ${{ vars.PYTHON_VERSION}}
|
|
||||||
- name: Install deps
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install .[build]
|
|
||||||
- name: Build
|
|
||||||
run: pyinstaller dyn2py.spec
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
name: Upload artifact
|
|
||||||
with:
|
|
||||||
name: dyn2py.exe
|
|
||||||
path: dist/dyn2py.exe
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
|
name: Create Github release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build-installer
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
name: Checkout
|
name: Checkout
|
||||||
@@ -51,17 +41,24 @@ jobs:
|
|||||||
uses: metcalfc/changelog-generator@v4.1.0
|
uses: metcalfc/changelog-generator@v4.1.0
|
||||||
with:
|
with:
|
||||||
myToken: ${{ secrets.GITHUB_TOKEN }}
|
myToken: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Download artifact
|
- name: Download exe
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: dyn2py.exe
|
name: dyn2py.exe
|
||||||
|
- name: Download installer
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: dyn2py-installer.exe
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
files: dyn2py.exe
|
files: |
|
||||||
body: ${{ steps.modified.outputs.log }}
|
dyn2py.exe
|
||||||
|
dyn2py-installer.exe
|
||||||
|
body: ${{ steps.changelog.outputs.changelog }}
|
||||||
|
|
||||||
pip:
|
pip:
|
||||||
|
name: Publish to PyPI
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: release
|
needs: release
|
||||||
steps:
|
steps:
|
||||||
@@ -70,7 +67,7 @@ jobs:
|
|||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
name: Setup Python
|
name: Setup Python
|
||||||
with:
|
with:
|
||||||
python-version: ${{ vars.PYTHON_VERSION}}
|
python-version: ${{ vars.PYTHON_VERSION }}
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
|
|||||||
8
.github/workflows/test.yml
vendored
8
.github/workflows/test.yml
vendored
@@ -8,11 +8,15 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
name: Workflow - Test
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
name: Run tests
|
||||||
runs-on: ${{ inputs.os }}
|
runs-on: ${{ inputs.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
name: Checkout
|
||||||
- name: Set up Python ${{ inputs.python-version }}
|
- name: Set up Python ${{ inputs.python-version }}
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
@@ -21,5 +25,5 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install .
|
pip install .
|
||||||
- name: Test
|
- name: Run tests
|
||||||
run: python -m unittest discover -v -s ./tests -p "test_*.py"
|
run: python -m unittest discover -v -s ./tests -p "test_*.py"
|
||||||
|
|||||||
1
.github/workflows/unittests.yml
vendored
1
.github/workflows/unittests.yml
vendored
@@ -11,6 +11,7 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
|
name: Unit tests
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest]
|
os: [ubuntu-latest, windows-latest]
|
||||||
|
|||||||
14
.github/workflows/website.yml
vendored
14
.github/workflows/website.yml
vendored
@@ -5,7 +5,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
# Allows you to run this workflow manually from the Actions tab
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
# security: restrict permissions for CI jobs.
|
# security: restrict permissions for CI jobs.
|
||||||
@@ -18,19 +17,22 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Build the documentation and upload the static HTML files as an artifact.
|
|
||||||
build:
|
build:
|
||||||
|
name: Build documentation
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
name: Checkout
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
|
name: Setup Python
|
||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: ${{ vars.PYTHON_VERSION }}
|
||||||
|
|
||||||
- run: pip install -e .[doc]
|
- run: pip install -e .[doc]
|
||||||
|
name: Install deps
|
||||||
- run: pdoc -d google -o docs dyn2py
|
- run: pdoc -d google -o docs dyn2py
|
||||||
|
name: Generate docs
|
||||||
- uses: actions/upload-pages-artifact@v1
|
- uses: actions/upload-pages-artifact@v1
|
||||||
|
name: Upload artifact
|
||||||
with:
|
with:
|
||||||
path: docs/
|
path: docs/
|
||||||
|
|
||||||
@@ -38,6 +40,7 @@ jobs:
|
|||||||
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
|
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
|
||||||
deploy:
|
deploy:
|
||||||
needs: build
|
needs: build
|
||||||
|
name: Publish documentation
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
pages: write
|
pages: write
|
||||||
@@ -47,4 +50,5 @@ jobs:
|
|||||||
url: ${{ steps.deployment.outputs.page_url }}
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
steps:
|
steps:
|
||||||
- id: deployment
|
- id: deployment
|
||||||
|
name: Deploy page
|
||||||
uses: actions/deploy-pages@v1
|
uses: actions/deploy-pages@v1
|
||||||
|
|||||||
17
.github/workflows/windows-build.yml
vendored
Normal file
17
.github/workflows/windows-build.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
name: Build Windows exe and installer
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
branches: ["main"]
|
||||||
|
# push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-exe:
|
||||||
|
uses: ./.github/workflows/build-exe.yml
|
||||||
|
name: Build Windows exe
|
||||||
|
|
||||||
|
build-installer:
|
||||||
|
name: Build Windows installer
|
||||||
|
needs: build-exe
|
||||||
|
uses: ./.github/workflows/build-installer.yml
|
||||||
11
README.md
11
README.md
@@ -3,7 +3,6 @@
|
|||||||
[](https://github.com/infeeeee/dyn2py/releases/latest)
|
[](https://github.com/infeeeee/dyn2py/releases/latest)
|
||||||
[](https://github.com/infeeeee/dyn2py/commits/main)
|
[](https://github.com/infeeeee/dyn2py/commits/main)
|
||||||
[](https://github.com/infeeeee/dyn2py/actions/workflows/unittests.yml)
|
[](https://github.com/infeeeee/dyn2py/actions/workflows/unittests.yml)
|
||||||

|
|
||||||
[](https://github.com/infeeeee/dyn2py/blob/main/LICENSE)
|
[](https://github.com/infeeeee/dyn2py/blob/main/LICENSE)
|
||||||
|
|
||||||
# dyn2py
|
# dyn2py
|
||||||
@@ -17,14 +16,16 @@ Use cases:
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### Windows portable
|
### Windows portable and installer
|
||||||
|
|
||||||
Prebuilt exe available from github releases.
|
Prebuilt portable exe and installer available from github releases.
|
||||||
|
|
||||||
No requirements, just download `dyn2py.exe` from release assets:
|
No requirements, just download `dyn2py.exe` or `dyn2py-installer.exe` from release assets:
|
||||||
|
|
||||||
https://github.com/infeeeee/dyn2py/releases/latest
|
https://github.com/infeeeee/dyn2py/releases/latest
|
||||||
|
|
||||||
|
Installer automatically adds the install folder to the path, so simply `dyn2py` can be called from anywhere.
|
||||||
|
|
||||||
### With pip
|
### With pip
|
||||||
|
|
||||||
For usage as a module or as a command line program
|
For usage as a module or as a command line program
|
||||||
@@ -178,8 +179,8 @@ pyinstaller dyn2py.spec
|
|||||||
|
|
||||||
### Create installer for Windows
|
### Create installer for Windows
|
||||||
|
|
||||||
- The already built exe should be in `dist\dyn2py.exe`
|
|
||||||
- Install Inno Setup: https://jrsoftware.org/isdl.php
|
- Install Inno Setup: https://jrsoftware.org/isdl.php
|
||||||
|
- The already built exe should be in `dist\dyn2py.exe`
|
||||||
- Run this in powershell:
|
- Run this in powershell:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
|
|||||||
2
TODO.md
2
TODO.md
@@ -15,6 +15,7 @@
|
|||||||
- [x] Tests on Windows
|
- [x] Tests on Windows
|
||||||
- [x] Windows Build
|
- [x] Windows Build
|
||||||
- [x] Pip
|
- [x] Pip
|
||||||
|
- [x] Windows Installer
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
@@ -25,6 +26,5 @@
|
|||||||
|
|
||||||
## Extra features maybe later
|
## Extra features maybe later
|
||||||
|
|
||||||
- [ ] Windows Installer
|
|
||||||
- [ ] Autocomplete
|
- [ ] Autocomplete
|
||||||
- [ ] Winget
|
- [ ] Winget
|
||||||
@@ -20,7 +20,7 @@ ChangesEnvironment=yes
|
|||||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: "dist\dyn2py.exe"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "dist\dyn2py.exe"; DestDir: "{app}"; Flags: ignoreversion external
|
||||||
|
|
||||||
|
|
||||||
[Code]
|
[Code]
|
||||||
|
|||||||
Reference in New Issue
Block a user