From 637667b9565f58ced612e0646ebf981b30220a18 Mon Sep 17 00:00:00 2001 From: Ircama Date: Sat, 16 Nov 2024 09:33:01 +0100 Subject: [PATCH] Automatically update version when pushing a tag --- .github/workflows/build.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 860b825..8ba3d92 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,19 @@ jobs: - name: Git Checkout uses: actions/checkout@v4 + - name: Update VERSION in python file ui.py + run: (Get-Content ui.py) -replace '^VERSION = ".*"$', 'VERSION = "${{ github.ref_name }}"' | Set-Content ui.py + + - name: Commit version update + run: | + git config --local user.name "github-actions[bot]" + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git commit -m "Update VERSION to ${{ github.ref_name }}" + + - name: Push changes + run: | + git push + - name: Install Python uses: actions/setup-python@v5 with: @@ -27,9 +40,7 @@ jobs: pip install -r requirements.txt - name: Run PyInstaller to create epson_print_conf.exe - run: > - python -m PyInstaller epson_print_conf.spec -- --default - --version ${{ github.ref_name }} + run: python -m PyInstaller epson_print_conf.spec -- --default - name: Zip the epson_print_conf.exe asset to epson_print_conf.zip run: |