31
31
needs :
32
32
- package_linux
33
33
runs-on : ubuntu-latest
34
- env :
35
- APP_VERSION : dev
36
34
steps :
35
+ - name : Extract Version Name
36
+ id : extract_name
37
+ uses : actions/github-script@v7
38
+ with :
39
+ result-encoding : string
40
+ script : |
41
+ if (context.payload.ref.startsWith('refs/tags/')) {
42
+ return context.payload.ref.replace(/refs\/tags\/v/, '');
43
+ }
44
+ return 'dev';
37
45
- name : Checkout code
38
46
uses : actions/checkout@v4
39
47
- name : Install rpm
@@ -47,11 +55,11 @@ jobs:
47
55
- name : Move file
48
56
run : mv LargeCsvReader.tar.xz rpm/SOURCES
49
57
- name : Build RPM
50
- run : rpmbuild -ba --define "_topdir $(pwd)/rpm" --define "app_version $APP_VERSION " rpm/LargeCsvReader.spec
58
+ run : rpmbuild -ba --define "_topdir $(pwd)/rpm" --define "app_version ${{ steps.extract_name.outputs.result }} " rpm/LargeCsvReader.spec
51
59
- name : Upload artifact
52
60
uses : actions/upload-artifact@v4
53
61
with :
54
- path : rpm/RPMS/x86_64/LargeCsvReader-${{ env.APP_VERSION }}-1.x86_64.rpm
62
+ path : rpm/RPMS/x86_64/LargeCsvReader-${{ steps.extract_name.outputs.result }}-1.x86_64.rpm
55
63
name : rpm
56
64
57
65
build_win_installer :
@@ -60,12 +68,26 @@ jobs:
60
68
- package_windows
61
69
runs-on : windows-latest
62
70
steps :
71
+ - name : Extract Version Name
72
+ id : extract_name
73
+ uses : actions/github-script@v7
74
+ with :
75
+ result-encoding : string
76
+ script : |
77
+ if (context.payload.ref.startsWith('refs/tags/')) {
78
+ return context.payload.ref.replace(/refs\/tags\/v/, '');
79
+ }
80
+ return 'dev';
63
81
- name : Checkout Code
64
82
uses : actions/checkout@v4
65
83
- name : Download built
66
84
uses : actions/download-artifact@v4
67
85
with :
68
86
name : windows-latest
87
+ - name : Set version
88
+ env :
89
+ VERSION : ${{ steps.extract_name.outputs.result }}
90
+ run : echo %VERSION% > appversion
69
91
- name : Move file
70
92
run : mv LargeCsvReader.exe windows
71
93
- name : Create Windows setup
74
96
- name : Upload artifact
75
97
uses : actions/upload-artifact@v4
76
98
with :
77
- path : windows/LargeCsvReaderSetup.exe
99
+ path : windows/Output/ LargeCsvReaderSetup.exe
78
100
name : win_installer
79
101
80
102
create_release :
0 commit comments