Skip to content

Commit e396c85

Browse files
committed
improv(ci): Include version in file names
1 parent 2cbe697 commit e396c85

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
on:
22
push:
3+
branches: '**'
4+
tags-ignore: '**'
35
pull_request:
46
release:
57
types: [published]
@@ -99,28 +101,30 @@ jobs:
99101
runs-on: ubuntu-latest
100102
needs: [linux-x86_64, windows-mingw32, macos]
101103
steps:
104+
- uses: actions/checkout@v2
105+
- run: echo VERSION=$(./.github/workflows/version.py) > $GITHUB_ENV
102106
- uses: actions/download-artifact@v2
103107
- uses: actions/upload-release-asset@v1
104108
env:
105109
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
106110
with:
107111
upload_url: ${{ github.event.release.upload_url }}
108112
asset_path: keyboard-configurator-linux-x86_64-${{ github.sha }}/keyboard-configurator-x86_64.AppImage
109-
asset_name: keyboard-configurator-x86_64.AppImage
113+
asset_name: keyboard-configurator-${{ env.VERSION }}-x86_64.AppImage
110114
asset_content_type: application/vnd.appimage
111115
- uses: actions/upload-release-asset@v1
112116
env:
113117
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114118
with:
115119
upload_url: ${{ github.event.release.upload_url }}
116120
asset_path: keyboard-configurator-mingw32-${{ github.sha }}/keyboard-configurator.msi
117-
asset_name: keyboard-configurator.msi
121+
asset_name: keyboard-configurator-${{ env.VERSION }}.msi
118122
asset_content_type: application/x-msi
119123
- uses: actions/upload-release-asset@v1
120124
env:
121125
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122126
with:
123127
upload_url: ${{ github.event.release.upload_url }}
124128
asset_path: keyboard-configurator-macos-${{ github.sha }}/keyboard-configurator.dmg
125-
asset_name: keyboard-configurator.dmg
129+
asset_name: keyboard-configurator-${{ env.VERSION }}.dmg
126130
asset_content_type: application/x-apple-diskimage

.github/workflows/version.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env python3
2+
3+
import json
4+
import subprocess
5+
6+
meta_str = subprocess.check_output(["cargo", "metadata", "--format-version", "1", "--no-deps"])
7+
meta = json.loads(meta_str)
8+
package = next(i for i in meta['packages'] if i['name'] == 'system76-keyboard-configurator')
9+
print(package['version'])

0 commit comments

Comments
 (0)