Changes for 0.11.1 #29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build, test & upload new version | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
env: | |
PY_VERSION: 3.12 | |
PRESETUP_CMD: pip install packaging psutil | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ windows-latest, ubuntu-latest ] | |
runs-on: ${{ matrix.os }} | |
# TODO: Add cache support | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{env.PY_VERSION}} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{env.PY_VERSION}} | |
- name: Setup environment | |
shell: bash | |
run: | | |
if [ "$RUNNER_OS" == "Linux" ] || [ "$RUNNER_OS" == "macOS" ]; then | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
else | |
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" | |
fi | |
${{env.PRESETUP_CMD}} | |
python setup.py setup | |
- name: Run tests | |
run: python -m pytest tests/ | |
build: | |
needs: test | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, windows-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{env.PY_VERSION}} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{env.PY_VERSION}} | |
- name: Setup environment | |
shell: bash | |
run: | | |
if [ "$RUNNER_OS" == "Linux" ] || [ "$RUNNER_OS" == "macOS" ]; then | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
else | |
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" | |
fi | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
sudo apt-get install libcairo-dev libgirepository1.0-dev python3-gi gobject-introspection gir1.2-gtk-3.0 gir1.2-appindicator3-0.1 | |
fi | |
${{env.PRESETUP_CMD}} | |
python setup.py setup | |
- name: Build | |
run: python setup.py build | |
- name: Upload files | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.os }} dist files | |
path: dist/discord.fm-* |