mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Refactor some repeated actions out of workflows.
This commit is contained in:
parent
e751b53241
commit
2a5e12dfc5
10
.github/actions/build-front-end/action.yaml
vendored
Normal file
10
.github/actions/build-front-end/action.yaml
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
name: Front-end build
|
||||||
|
description: Builds the Liberation front-end.
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Build client
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
cd client
|
||||||
|
npm run build
|
||||||
16
.github/actions/mypy/action.yaml
vendored
Normal file
16
.github/actions/mypy/action.yaml
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
name: mypy
|
||||||
|
description: Type checks Python code.
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: mypy game
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
./venv/scripts/activate
|
||||||
|
mypy game
|
||||||
|
|
||||||
|
- name: mypy tests
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
./venv/scripts/activate
|
||||||
|
mypy tests
|
||||||
15
.github/actions/setup-liberation-js/action.yaml
vendored
Normal file
15
.github/actions/setup-liberation-js/action.yaml
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
name: Liberation JS set-up
|
||||||
|
description: Sets up the Liberation Javascript environment.
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: "16"
|
||||||
|
|
||||||
|
- name: npm ci
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
cd client
|
||||||
|
npm ci
|
||||||
22
.github/actions/setup-liberation-python/action.yaml
vendored
Normal file
22
.github/actions/setup-liberation-python/action.yaml
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
name: Liberation Python set-up
|
||||||
|
description: Sets up the Liberation Python environment.
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: "3.10"
|
||||||
|
|
||||||
|
- name: Install environment
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
python -m venv ./venv
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
./venv/scripts/activate
|
||||||
|
python -m pip install -r requirements.txt
|
||||||
|
# For some reason the shiboken2.abi3.dll is not found properly, so I copy it instead
|
||||||
|
Copy-Item .\venv\Lib\site-packages\shiboken2\shiboken2.abi3.dll .\venv\Lib\site-packages\PySide2\ -Force
|
||||||
49
.github/workflows/build.yml
vendored
49
.github/workflows/build.yml
vendored
@ -10,50 +10,21 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python environment
|
||||||
uses: actions/setup-python@v2
|
uses: ./.github/actions/setup-liberation-python
|
||||||
with:
|
|
||||||
python-version: "3.10"
|
|
||||||
|
|
||||||
- name: Set up Node
|
- name: Set up JS environment
|
||||||
uses: actions/setup-node@v2
|
uses: ./.github/actions/setup-liberation-js
|
||||||
with:
|
|
||||||
node-version: "16"
|
|
||||||
|
|
||||||
- name: Install environment
|
- name: mypy
|
||||||
run: |
|
uses: ./.github/actions/mypy
|
||||||
python -m venv ./venv
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
./venv/scripts/activate
|
|
||||||
python -m pip install -r requirements.txt
|
|
||||||
# For some reason the shiboken2.abi3.dll is not found properly, so I copy it instead
|
|
||||||
Copy-Item .\venv\Lib\site-packages\shiboken2\shiboken2.abi3.dll .\venv\Lib\site-packages\PySide2\ -Force
|
|
||||||
|
|
||||||
- name: mypy game
|
|
||||||
run: |
|
|
||||||
./venv/scripts/activate
|
|
||||||
mypy game
|
|
||||||
|
|
||||||
- name: mypy tests
|
|
||||||
run: |
|
|
||||||
./venv/scripts/activate
|
|
||||||
mypy tests
|
|
||||||
|
|
||||||
- name: update build number
|
- name: update build number
|
||||||
run: |
|
run: |
|
||||||
[IO.File]::WriteAllLines($pwd.path + "\resources\buildnumber", $env:GITHUB_RUN_NUMBER)
|
[IO.File]::WriteAllLines($pwd.path + "\resources\buildnumber", $env:GITHUB_RUN_NUMBER)
|
||||||
|
|
||||||
- name: npm ci
|
- name: Build front-end
|
||||||
run: |
|
uses: ./.github/actions/build-front-end
|
||||||
cd client
|
|
||||||
npm ci
|
|
||||||
|
|
||||||
- name: Build client
|
|
||||||
run: |
|
|
||||||
cd client
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
- name: Build binaries
|
- name: Build binaries
|
||||||
run: |
|
run: |
|
||||||
@ -62,7 +33,9 @@ jobs:
|
|||||||
pyinstaller pyinstaller.spec
|
pyinstaller pyinstaller.spec
|
||||||
|
|
||||||
- name: Create archive
|
- name: Create archive
|
||||||
run: Compress-Archive -Path .\dist\dcs_liberation\ -DestinationPath dist\dcs_liberation.zip
|
run:
|
||||||
|
Compress-Archive -Path .\dist\dcs_liberation\ -DestinationPath
|
||||||
|
dist\dcs_liberation.zip
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
35
.github/workflows/release.yml
vendored
35
.github/workflows/release.yml
vendored
@ -12,40 +12,21 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python environment
|
||||||
uses: actions/setup-python@v2
|
uses: ./.github/actions/setup-liberation-python
|
||||||
with:
|
|
||||||
python-version: "3.10"
|
|
||||||
|
|
||||||
- name: Set up Node
|
- name: Set up JS environment
|
||||||
uses: actions/setup-node@v2
|
uses: ./.github/actions/setup-liberation-js
|
||||||
with:
|
|
||||||
node-version: "16"
|
|
||||||
|
|
||||||
- name: Install environment
|
|
||||||
run: |
|
|
||||||
python -m venv ./venv
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
./venv/scripts/activate
|
|
||||||
python -m pip install -r requirements.txt
|
|
||||||
# For some reason the shiboken2.abi3.dll is not found properly, so I copy it instead
|
|
||||||
Copy-Item .\venv\Lib\site-packages\shiboken2\shiboken2.abi3.dll .\venv\Lib\site-packages\PySide2\ -Force
|
|
||||||
|
|
||||||
- name: Finalize version
|
- name: Finalize version
|
||||||
run: |
|
run: |
|
||||||
New-Item -ItemType file resources\final
|
New-Item -ItemType file resources\final
|
||||||
|
|
||||||
- name: npm ci
|
- name: mypy
|
||||||
run: |
|
uses: ./.github/actions/mypy
|
||||||
cd client
|
|
||||||
npm ci
|
|
||||||
|
|
||||||
- name: mypy game
|
- name: Build front-end
|
||||||
run: |
|
uses: ./.github/actions/build-front-end
|
||||||
./venv/scripts/activate
|
|
||||||
mypy game
|
|
||||||
|
|
||||||
- name: Build binaries
|
- name: Build binaries
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user