Skip to content

Commit

Permalink
Automatically update version when pushing a tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Ircama committed Nov 16, 2024
1 parent 0f163a6 commit 9689008
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,24 @@ jobs:
- name: Git Checkout
uses: actions/checkout@v4

- name: Update VERSION in python file ui.py
$VERSION = "${{ github.ref_name }}"
run: |
$VERSION = "${{ github.ref_name }}"
if ($VERSION.StartsWith('v')) {
$VERSION = $VERSION.Substring(1)
}
(Get-Content ui.py) -replace '^VERSION = ".*"$', "VERSION = `"$VERSION`"" | Set-Content ui.py
- name: Commit and push version update
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add ui.py
git commit -m "Update VERSION to ${{ github.ref_name }}"
git remote set-url origin https://Ircama:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git push origin main
- name: Install Python
uses: actions/setup-python@v5
with:
Expand All @@ -27,9 +45,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: |
Expand Down

0 comments on commit 9689008

Please sign in to comment.