Skip to content

Update workflow

Update workflow #26

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
branches:
- release/*
pull_request:
permissions:
contents: write
jobs:
get-version:
runs-on: ubuntu-latest
steps:
- uses: winterjung/split@v2
id: split
with:
msg: ${{ github.ref_name }}
separator: '/'
- name: Save version to file
run: echo ${{ steps.split.outputs._1 }} > version.txt
- uses: actions/upload-artifact@v3
with:
name: version.txt
path: version.txt
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r adbgateway/requirements.txt
pip install pyinstaller
- name: Build
run: pyinstaller adbgateway.spec
- uses: actions/upload-artifact@v3
with:
name: linux-${{ steps.split.outputs._1 }}
path: dist/adbgateway
build-windows:
needs: get-version
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
merge-multiple: true
- name: Load version from file
id: version
shell: bash
run: |
content=`cat version.txt/version.txt`
echo "::set-output name=version::$content"
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r adbgateway/requirements.txt
pip install pyinstaller pyinstaller-versionfile
- name: Generate version file
run: create-version-file metadata.yaml --outfile file_info.txt --version ${{ steps.version.outputs.version }}
- name: Build
run: pyinstaller adbgateway.spec
- uses: actions/upload-artifact@v3
with:
name: windows-${{ steps.version.outputs.version }}.exe
path: dist/adbgateway.exe
release:
runs-on: ubuntu-latest
needs: [build-linux, build-windows]
steps:
- uses: actions/download-artifact@v3
with:
path: artifacts
merge-multiple: true
- name: Release
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: true
tag_name: ${{ steps.split.outputs._1 }}
name: ${{ steps.split.outputs._1 }}
files: |
artifacts/linux-${{ steps.split.outputs._1 }}
artifacts/windows-${{ steps.split.outputs._1 }}.exe