Skip to content

chore: version.json missing #88

chore: version.json missing

chore: version.json missing #88

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: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
python -m venv .venv
.venv/Scripts/activate
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest
git apply --unsafe-paths --verbose .\drafthorse_pdf.patch
- name: Lint with flake8
run: |
.venv/Scripts/deactivate
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude .venv
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude .venv
- name: Test with pytest
run: |
.venv/Scripts/activate
pytest --doctest-modules --junitxml=junit/test-results.xml
- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
name: pytest-results
path: junit/test-results.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
- name: get get-next-version
run: |
Invoke-WebRequest -uri https://github.com/thenativeweb/get-next-version/releases/download/2.6.1/get-next-version-windows-amd64.exe -outfile get-next-version-windows-amd64.exe
ls
.\get-next-version-windows-amd64.exe -p 'v' --target json > version.json
shell: powershell
- name: Build with pyinstaller
run: |
.venv/Scripts/activate
pyinstaller excel2zugferd.py --noconsole --add-data _internal/Fonts:Fonts --add-data ./.venv/Lib/site-packages/drafthorse/schema:drafthorse/schema --add-data version.json:. --noconfirm
more version.json
- name: Deploy artifacts
uses: actions/upload-artifact@v4
id: artifact
with:
name: excel2zugferd
path: dist/excel2zugferd*
if-no-files-found: error
release:
name: Release
runs-on: ubuntu-latest
needs: build
concurrency: release
permissions:
id-token: write
contents: write
steps:
- name: Clone Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Semantic Release
uses: thenativeweb/[email protected]
with:
prefix: 'v'
id: get_next_version
- name: Create new tag
if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }}
run: |
NEXT_VERSION=${{ steps.get_next_version.outputs.version }}
git tag $NEXT_VERSION
git push origin $NEXT_VERSION
- name: Create Release
if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.get_next_version.outputs.version }}
run: |
gh release create ${{ steps.get_next_version.outputs.version }} \
--repo="$GITHUB_REPOSITORY" \
--title="Version ${tag}" \
--generate-notes
- name: Download Artifact
if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }}
uses: dawidd6/action-download-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
name: excel2zugferd
skip_unpack: true
- name: Upload Release Asset
if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ steps.get_next_version.outputs.version }} ./excel2zugferd.zip