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 2f28901
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,27 @@ jobs:
steps:
- name: Git Checkout
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0 # Fetch all history for accurate commits and tags

- 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
Expand All @@ -27,9 +48,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 2f28901

Please sign in to comment.