Skip to content

Commit 7d79e68

Browse files
committed
Add a packaging step to CI/CD
1 parent d257a3f commit 7d79e68

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/ubuntu.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Ubuntu
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip ubuntu]')"
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Configure
19+
run: |
20+
cmake -S. -Bbuild -DENABLE_PACKAGING=ON -DCPACK_PACKAGE_FILE_NAME=IR
21+
22+
- name: Build the release tar.xz package
23+
if: github.ref == 'refs/heads/main'
24+
run: cpack -G TXZ --config build/CPackConfig.cmake
25+
26+
- name: Push release
27+
if: github.ref == 'refs/heads/main'
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
30+
run: |
31+
echo "Pushing to the latest tag"
32+
gh release create latest --title "Latest release from main" --notes "This release gets updated with each commit to main" || true
33+
gh release upload latest IR.tar.xz --clobber
34+
35+
version="$(cat docs/ReleaseNotes/version)"
36+
echo "Making sure the release ${version} is online"
37+
test -f docs/ReleaseNotes/${version}.md
38+
gh release create "${version}" --title "${version}" --notes-file "docs/ReleaseNotes/${version}.md" || true
39+
gh release upload "${version}" IR.tar.xz || true
40+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# Files
1010
!.clang-format
1111
!.gitignore
12+
!.github
1213
!CMakeLists.txt
1314
!COPYRIGHT.md
1415
!LICENSE.md

0 commit comments

Comments
 (0)