-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (56 loc) · 1.98 KB
/
python-build.yml
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
# 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.10', architecture: x64}
- {os: macos-latest, python-version: '3.10', architecture: x64}
- {os: ubuntu-latest, python-version: '3.10', architecture: x64}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.cfg.python-version }} ${{ matrix.cfg.architecture }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.cfg.python-version }}
architecture: ${{ matrix.cfg.architecture }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip install setuptools wheel twine pyinstaller~=5.6 build
- name: Build and publish to PyPi
if: matrix.cfg.os != 'ubuntu-latest'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.AMULET_EDITOR_PYPI_PASSWORD }}
run: |
python -m build -C--build-option=--freeze-first=True
python -m twine upload dist/amulet[_-]editor* --skip-existing
- name: Install Ubuntu dependencies
if: matrix.cfg.os == 'ubuntu-latest'
run: |
sudo apt-get install ruby-dev build-essential
sudo gem i fpm -f
- name: Create Installer
run: |
pip install git+https://github.com/Amulet-Team/python-build-tool.git
pip install --upgrade --upgrade-strategy eager -e .
pbt freeze
pbt installer
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
with:
files: |
target/*.exe
target/*.deb
target/*.dmg