Merge pull request #290 from KevinBytesTheDust/dev_v7 #15
Workflow file for this run
This file contains 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 and Release | |
on: | |
push: | |
tags: | |
- "v*" | |
env: | |
PLAYWRIGHT_BROWSERS_PATH: 0 | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-2022, ubuntu-20.04, macos-12, macos-14] #14 is M1 | |
python-version: [3.11] | |
runs-on: ${{ matrix.os }} | |
name: Build ${{ matrix.os }} executable | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install poetry | |
run: pip install poetry | |
- name: Get packages via poetry | |
run: poetry install | |
- name: Get CVAmp version number | |
uses: SebRollen/[email protected] | |
id: read_toml | |
with: | |
file: 'pyproject.toml' | |
field: 'tool.poetry.version' | |
- name: Create date and file name env variable | |
shell: bash | |
run: | | |
export today=$(date +'%Y%m%d') | |
echo "output_filename=CVAmp_v${{steps.read_toml.outputs.value}}_${today}_${{runner.os}}-${{runner.arch}}" >> $GITHUB_ENV | |
- name: Build executable | |
shell: bash | |
run: | | |
if [ "$RUNNER_OS" == "Windows" ]; then | |
poetry run pyinstaller main_gui.py --onefile --add-binary "cvamp_logo.ico;." --add-binary "pyproject.toml;." --icon cvamp_logo.ico --name ${{env.output_filename}} | |
else | |
poetry run pyinstaller main_gui.py --onefile --add-binary "cvamp_logo.ico:." --hidden-import=tkinter --add-binary "pyproject.toml:." --icon cvamp_logo.ico --name ${{env.output_filename}}.bin | |
fi | |
mv ./proxy/ ./dist/ | |
- name: Zip executable | |
uses: vimtor/action-zip@v1 | |
with: | |
files: dist/ | |
dest: ${{env.output_filename}}.zip | |
- name: Upload zipped artifact ${{ matrix.os }} | |
uses: actions/upload-artifact@v1 | |
with: | |
name: ${{env.output_filename}} | |
path: ${{env.output_filename}}.zip | |
draft_release: | |
needs: build | |
runs-on: ubuntu-latest | |
name: Draft one big release | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download all artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: artifacts | |
- name: Create draft release with artifacts | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: CVAmp ${{github.ref_name}} | |
body_path: docs/release_template_text.md | |
prerelease: false | |
draft: true | |
files: artifacts/**/*.zip # glob pattern which will match all zip files in any subdirectory of artifacts. |