mirror of
https://github.com/spencershepard/RotorOps.git
synced 2025-11-10 15:45:30 +00:00
update workflows to build exe
This commit is contained in:
parent
c2d19616ab
commit
63a70806e0
78
.github/workflows/main.yml
vendored
78
.github/workflows/main.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Deploy-to-updater
|
name: Build-and-deploy
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@ -7,16 +7,58 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build-exe:
|
||||||
deploy:
|
runs-on: windows-latest
|
||||||
if: github.event.pull_request.merged == true
|
name: Build the executable
|
||||||
runs-on: ubuntu-latest # windows-latest | macos-latest
|
|
||||||
name: Deploy to updater if files changed
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
|
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
|
||||||
|
|
||||||
|
- name: Set up Python 3.10.7
|
||||||
|
uses: actions/setup-python@v3
|
||||||
|
with:
|
||||||
|
python-version: "3.10.7"
|
||||||
|
|
||||||
|
- name: Install requirements from requirements.txt
|
||||||
|
run: |
|
||||||
|
cd Generator
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
- name: Build UI resources
|
||||||
|
run: |
|
||||||
|
cd Generator
|
||||||
|
pyuic5 -x MissionGeneratorUI.ui -o MissionGeneratorUI.py
|
||||||
|
pyrcc5 -o resources.py resources.qrc
|
||||||
|
|
||||||
|
- name: Build the executable
|
||||||
|
run: |
|
||||||
|
cd Generator
|
||||||
|
pyinstaller MissionGenerator.spec --clean --log-level=DEBUG
|
||||||
|
|
||||||
|
- name: Archive the executable
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: MissionGenerator
|
||||||
|
path: Generator/dist/MissionGenerator.exe
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
if: github.event.pull_request.merged == true
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Deploy to updater
|
||||||
|
needs: build-exe
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
|
||||||
|
|
||||||
|
- name: Retrieve the executable
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: MissionGenerator
|
||||||
|
|
||||||
- name: Get monitored changed files
|
- name: Get monitored changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v35
|
uses: tj-actions/changed-files@v35
|
||||||
@ -28,46 +70,32 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "changed_files=${{ steps.changed-files.outputs.all_changed_files }}" >> $GITHUB_ENV
|
echo "changed_files=${{ steps.changed-files.outputs.all_changed_files }}" >> $GITHUB_ENV
|
||||||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
||||||
echo "$file was changed"
|
echo "$file was changed and will be added to updater"
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Test env vars
|
|
||||||
run: |
|
|
||||||
echo "${{env.changed_files}}"
|
|
||||||
|
|
||||||
- name: Set up Python 3.10
|
- name: Set up Python 3.10
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
uses: actions/setup-python@v3
|
uses: actions/setup-python@v3
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
python-version: "3.10"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install PyYAML
|
pip install PyYAML
|
||||||
|
|
||||||
- name: Run release_script.py
|
- name: Run release_script.py
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
env:
|
env:
|
||||||
FTP_SERVER: ${{ secrets.FTP_SERVER }}
|
FTP_SERVER: ${{ secrets.FTP_SERVER }}
|
||||||
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
|
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
|
||||||
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
|
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
python release_script.py
|
python release_script.py
|
||||||
|
|
||||||
|
|
||||||
- name: FTP-Deploy
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
uses: actions/checkout@v2.1.0
|
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- name: FTP-Deploy-Action
|
- name: FTP-Deploy-Action
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
uses: SamKirkland/FTP-Deploy-Action@4.3.3
|
uses: SamKirkland/FTP-Deploy-Action@4.3.3
|
||||||
with:
|
with:
|
||||||
server: ${{ secrets.FTP_SERVER }}
|
server: ${{ secrets.FTP_SERVER }}
|
||||||
username: ${{ secrets.FTP_USERNAME }}
|
username: ${{ secrets.FTP_USERNAME }}
|
||||||
password: ${{ secrets.FTP_PASSWORD }}
|
password: ${{ secrets.FTP_PASSWORD }}
|
||||||
server-dir: Updates/continuous/
|
server-dir: Updates/continuous/
|
||||||
|
dry-run: false
|
||||||
|
|||||||
85
.github/workflows/pre-deploy.yml
vendored
Normal file
85
.github/workflows/pre-deploy.yml
vendored
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
name: Pre-deployment build check
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
- edited
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
version-increment-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Check if version number was incremented
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Python 3.10
|
||||||
|
uses: actions/setup-python@v3
|
||||||
|
with:
|
||||||
|
python-version: "3.10"
|
||||||
|
|
||||||
|
- name: Get the version string from the working directory
|
||||||
|
run: |
|
||||||
|
cd Generator
|
||||||
|
VERSION=$(python -c "from version import *; print(version_string)")
|
||||||
|
echo NEW_VERSION=$VERSION >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Get the current version string from main branch
|
||||||
|
run: |
|
||||||
|
git fetch origin main
|
||||||
|
git checkout main
|
||||||
|
cd Generator
|
||||||
|
VERSION=$(python -c "from version import *; print(version_string)")
|
||||||
|
echo CURRENT_VERSION=$VERSION >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Install packaging module
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install packaging
|
||||||
|
|
||||||
|
- name: Check if version number was incremented
|
||||||
|
run: |
|
||||||
|
python -c "from packaging import version as ver; assert ver.parse('${{env.NEW_VERSION}}') > ver.parse('${{env.CURRENT_VERSION}}'), 'Version number was not incremented'"
|
||||||
|
|
||||||
|
build-exe:
|
||||||
|
needs: version-increment-check
|
||||||
|
runs-on: windows-latest
|
||||||
|
name: Build the executable
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
|
||||||
|
|
||||||
|
- name: Set up Python 3.10.7
|
||||||
|
uses: actions/setup-python@v3
|
||||||
|
with:
|
||||||
|
python-version: "3.10.7"
|
||||||
|
|
||||||
|
- name: Install requirements from requirements.txt
|
||||||
|
run: |
|
||||||
|
cd Generator
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
- name: Build UI resources
|
||||||
|
run: |
|
||||||
|
cd Generator
|
||||||
|
pyuic5 -x MissionGeneratorUI.ui -o MissionGeneratorUI.py
|
||||||
|
pyrcc5 -o resources.py resources.qrc
|
||||||
|
|
||||||
|
- name: Build the executable
|
||||||
|
run: |
|
||||||
|
cd Generator
|
||||||
|
pyinstaller MissionGenerator.spec --clean --log-level=DEBUG
|
||||||
|
|
||||||
|
- name: Archive the executable
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: MissionGenerator
|
||||||
|
path: Generator/dist/MissionGenerator.exe
|
||||||
|
if-no-files-found: error
|
||||||
2
.github/workflows/python.yml
vendored
2
.github/workflows/python.yml
vendored
@ -9,7 +9,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.8", "3.9", "3.10"]
|
python-version: ["3.10"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@ -27,4 +27,5 @@ MissionOutput/
|
|||||||
*.env
|
*.env
|
||||||
RotorOps_setup.exe
|
RotorOps_setup.exe
|
||||||
Generator/resources.py
|
Generator/resources.py
|
||||||
venv
|
venv
|
||||||
|
MissionGenerator.exe
|
||||||
@ -96,6 +96,8 @@ example:
|
|||||||
|
|
||||||
# Building new RotorOps_setup.exe installer package
|
# Building new RotorOps_setup.exe installer package
|
||||||
|
|
||||||
|
For a new release, the installer package must be built on your dev machine and attached to the release on GitHub. Installforge does not offer a CLI.
|
||||||
|
|
||||||
Uses https://installforge.net/
|
Uses https://installforge.net/
|
||||||
See install-config.ifp and installforge_constants.txt
|
See install-config.ifp and installforge_constants.txt
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
-e git+https://github.com/spencershepard/dcs@48b32ae917b2a67d9409345a1f5c368e59e5229f#egg=pydcs
|
git+https://github.com/spencershepard/dcs@48b32ae917b2a67d9409345a1f5c368e59e5229f
|
||||||
packaging==21.3
|
packaging==21.3
|
||||||
PyQt5==5.15.9
|
PyQt5==5.15.9
|
||||||
PyYAML==6.0
|
PyYAML==6.0
|
||||||
|
|||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user