-
Notifications
You must be signed in to change notification settings - Fork 11
99 lines (85 loc) · 3.3 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: release_pipeline
on:
workflow_dispatch:
inputs:
version:
description: New version tag. Must match the format <major>.<minor>.<patch>. All positions can consist of alphanumerical characters.
type: string
required: true
changelog:
description: What has changed since the last release. Markdown syntax is supportet. Captions should be on level 3 (###) or lower.
type: string
branch:
description: What branch to use to publish from
type: string
default: main
required: true
name:
description: Who is author of this release
type: string
default: Fabian Jung
required: true
email:
description: What is you mail address
type: string
default: git@fabian-jung.net
required: true
env:
GH_TOKEN: ${{ github.token }}
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: workflow configuration
run: |
echo "releasing ${{ toJSON(github.event.inputs) }}"
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{github.event.inputs.branch}}
- name: bump version
run: |
echo -e "${{github.event.inputs.changelog}}" | ./scripts/bump_version.sh ${{github.event.inputs.version}}
- name: Commit & tag
run: |
git config --global user.name '${{github.event.inputs.name}}'
git config --global user.email '${{github.event.inputs.email}}'
git add CMakeLists.txt
git add doc/Changelog.md
git add scripts/package/arch/PKGBUILD
git add vcpkg.json
git commit -m "Bump version to ${{github.event.inputs.version}}"
git tag -a "v${{github.event.inputs.version}}" -m "${{github.event.inputs.changelog}}"
git push
- name: publish release
run: gh release create v${{github.event.inputs.version}} -t v${{github.event.inputs.version}} --target ${{github.event.inputs.branch}} --notes "${{github.event.inputs.changelog}}" --latest
package:
runs-on: ubuntu-22.04
needs: release
steps:
- name: install deps
run: |
sudo apt-get update -y
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get install -y clang-14 libclang-cpp14-dev libclang-14-dev ninja-build
sudo apt-get install -y curl zip unzip tar pkg-config python3.10-venv flex bison
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Restore artifacts, or setup vcpkg (do not install any package)
uses: lukka/run-vcpkg@v10
with:
vcpkgDirectory: '${{ github.workspace }}/vendor/vcpkg'
- name: Run CMake consuming CMakePreset.json and vcpkg.json by mean of vcpkg.
uses: lukka/run-cmake@v10
with:
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
configurePreset: 'clang-fetch_content-release'
buildPreset: 'clang-fetch_content-release'
- name: Upload artifacts to the release
run: |
cd build-fetch_content
cpack
gh release upload v${{github.event.inputs.version}} tsmp-${{github.event.inputs.version}}-Linux.tgz tsmp-${{github.event.inputs.version}}-Linux.deb --clobber