File tree Expand file tree Collapse file tree 3 files changed +77
-1
lines changed
Expand file tree Collapse file tree 3 files changed +77
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ version : 2
3+ updates :
4+ - package-ecosystem : github-actions
5+ directory : /
6+ schedule :
7+ interval : monthly
8+ - package-ecosystem : gitsubmodule
9+ directory : /
10+ schedule :
11+ interval : monthly
Original file line number Diff line number Diff line change 1+ ---
2+ " on " :
3+ push :
4+ paths-ignore :
5+ - " **.md"
6+ pull_request :
7+ paths-ignore :
8+ - " **.md"
9+ workflow_dispatch :
10+
11+ # https://github.com/softprops/action-gh-release/issues/236
12+ permissions :
13+ contents : write
14+
15+ jobs :
16+ build :
17+ runs-on : ubuntu-latest
18+ steps :
19+ - uses : actions/checkout@v4
20+ - name : Install dependencies
21+ run : |
22+ sudo apt-get -y update
23+ sudo apt-get -y install rpm
24+ - name : Build
25+ run : |
26+ cmake -Bbuild
27+ cmake --build build
28+ cmake --build build
29+ # TODO: disable ctest because we haven't add any test
30+ # ctest --test-dir build
31+ cd build
32+ cpack -G DEB
33+ cpack -G RPM
34+ # TODO: disable codecov because we disable ctest
35+ # - uses: codecov/codecov-action@v3
36+ # with:
37+ # gcov: true
38+ - uses : actions/upload-artifact@v3
39+ if : " ! startsWith(github.ref, 'refs/tags/')"
40+ with :
41+ path : |
42+ build/*.deb
43+ build/*.rpm
44+ - uses : softprops/action-gh-release@v1
45+ if : startsWith(github.ref, 'refs/tags/')
46+ with :
47+ files : |
48+ build/*.deb
49+ build/*.rpm
50+
51+ deploy-aur :
52+ needs : build
53+ runs-on : ubuntu-latest
54+ if : startsWith(github.ref, 'refs/tags/')
55+ steps :
56+ - uses : Freed-Wu/update-aur-package@v1.0.11
57+ with :
58+ package_name : g3kb-switch
59+ ssh_private_key : ${{secrets.AUR_SSH_PRIVATE_KEY}}
Original file line number Diff line number Diff line change @@ -2,11 +2,17 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.20)
22
33SET (name g3kb-switch)
44SET (HOMEPAGE_URL https://github.com/lyokha/g3kb-switch)
5+ # get version from git tag in github action
6+ STRING (REGEX MATCH [[ [0-9](\.[0-9])*]] VERSION "$ENV{GITHUB_REF_NAME} " )
7+ IF (NOT VERSION)
8+ # a fallback
9+ SET (VERSION 0.0.0.0)
10+ ENDIF ()
511PROJECT (${name}
612 LANGUAGES C
713 HOMEPAGE_URL ${HOMEPAGE_URL}
814 DESCRIPTION "CLI keyboard layout switcher for Gnome 3 and 4x"
9- VERSION 1.3 )
15+ VERSION ${VERSION} )
1016SET (CMAKE_INCLUDE_CURRENT_DIR ON )
1117
1218INCLUDE (GNUInstallDirs )
You can’t perform that action at this time.
0 commit comments