-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
) * adding versioning process to the CI * removing the unrequired character * adding ignores for version tags * Adding tag versioned CI * Separated CI for patch releases and major/minor releases * adding edge case for github tag-ignores in major/minor version releases * dummy commit for the tag change * Dummy change * changing ignore filter * Removing double v from versioning * changing main tag related push * removing main branch condition * dummy change for testing CI * Removed commented out code from ci --------- Co-authored-by: marshal-dteach <marshal-dteach@github.com> Co-authored-by: SCC/楊志璿 <zxc25077667@gmail.com>
- Loading branch information
1 parent
3e6ed83
commit efb9aea
Showing
2 changed files
with
104 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: C/C++ Major/Minor Release CI | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' # Trigger the workflow on version tags like v1.0.0 | ||
release: | ||
types: [created] | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache CMake and build files | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cache | ||
build | ||
key: ${{ runner.os }}-cmake-${{ hashFiles('**/CMakeLists.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-cmake- | ||
- name: Install C++ build tools and dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y cmake g++ make build-essential --no-install-recommends | ||
- name: Configure CMake | ||
run: | | ||
mkdir -p build | ||
cmake -S . -B build | ||
- name: Build the project | ||
run: | | ||
cmake --build build | ||
- name: Run unit tests | ||
run: | | ||
ctest --test-dir build --output-on-failure | ||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create release directory | ||
run: | | ||
mkdir release | ||
shopt -s extglob | ||
cp -r !(release) release/ | ||
- name: Create release zip file | ||
run: | | ||
cd release | ||
zip -r ../release.zip . | ||
- name: Create release tarball file | ||
run: | | ||
cd release | ||
tar -czvf ../release.tar.gz . | ||
- name: Create Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | ||
with: | ||
tag_name: "${{ github.ref_name }}" | ||
name: "Release ${{ github.ref_name }}" | ||
body: "Release for commit number ${{ github.ref_name }}" | ||
files: | | ||
release.zip | ||
release.tar.gz |