-
-
Notifications
You must be signed in to change notification settings - Fork 150
73 lines (59 loc) · 2.05 KB
/
python-build.yml
File metadata and controls
73 lines (59 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Build
on:
release:
types: [published]
jobs:
deploy:
runs-on: ${{ matrix.cfg.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
cfg:
- {os: windows-latest, python-version: '3.11', architecture: x64}
steps:
- name: Clone
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.cfg.python-version }} ${{ matrix.cfg.architecture }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.cfg.python-version }}
architecture: ${{ matrix.cfg.architecture }}
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine pyinstaller~=6.18 build
- name: Setup
run: |
export BDISTWHEELFREEZELIBS=true
python -m build
python -m pip install dist/amulet_map_editor-*.whl --upgrade
- name: PyInstaller build
run: |
python -m PyInstaller -y --distpath ./installer/dist installer/Amulet.spec
- name: Install NSIS
if: runner.os == 'Windows'
uses: repolevedavaj/install-nsis@v1.1.0
with:
nsis-version: '3.11'
- name: Windows Installer
if: runner.os == 'Windows'
run: |
makensis -DVERSION=${{ github.event.release.tag_name }} installer\windows.nsi
- name: Publish to PyPi
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.AMULET_MAP_EDITOR_PYPI_PASSWORD }}
run: |
twine upload dist/amulet[_-]map[_-]editor* --skip-existing
- name: Upload Release Asset
uses: actions/upload-artifact@v4
with:
name: Amulet-${{ github.event.release.tag_name }}-${{ runner.os }}-${{ matrix.cfg.architecture }}
path: ./installer/dist