Konano/arknights-mower

View on GitHub
.github/workflows/pyinstaller-win-alpha.yml

Summary

Maintainability
Test Coverage
name: Windows Binary Package (Alpha)

on:
  push:
    tags:
      - 'v[0-9]+.[0-9]+.[0-9]+a[0-9]+'

jobs:
  build-win-amd64:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v2
      - name: Get the version
        id: get_version
        shell: bash
        run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
      - name: Set up Python 3.9 amd64
        uses: actions/setup-python@v2
        with:
          python-version: 3.9
          architecture: x64
      - name: Install dependencies
        shell: cmd
        run: |
          python -m pip install --upgrade pip
          python -m venv venv64
          venv64\Scripts\python -m pip install --upgrade pip wheel setuptools
          venv64\Scripts\python -m pip install -r requirements.txt
          venv64\Scripts\python -m pip install pyinstaller
      - name: Make package
        shell: cmd
        run: |
          venv64\Scripts\pyinstaller .\main.spec
          md public
          move dist\main.exe public\arknights_mower.exe
      - name: Package into zip
        uses: vimtor/action-zip@v1
        with:
          files: public/
          recursive: false
          dest: arknights-mower_cp39_win_amd64_${{ steps.get_version.outputs.VERSION }}.zip
      - name: Release
        uses: softprops/action-gh-release@v1
        with:
          draft: true
          prerelease: true
          body_path: doc/CHANGELOG.md
          files: arknights-mower_cp39_win_amd64_${{ steps.get_version.outputs.VERSION }}.zip