55 branches :
66 - " master"
77 tags :
8- - ' v*.*.*'
8+ - ' v*.*.*' # Trigger workflow on version tags (e.g., v1.0.0)
99 pull_request :
1010 branches :
1111 - " master"
@@ -27,30 +27,11 @@ jobs:
2727 - name : Build with CMake
2828 run : docker run --rm -v ${{ github.workspace }}:/cpp_tutorials mycpp_image:latest cmake --build /cpp_tutorials/build --config Release
2929
30- # Verify if build files are generated
31- - name : List build directory contents
32- run : docker run --rm -v ${{ github.workspace }}:/cpp_tutorials mycpp_image:latest ls -la /cpp_tutorials/build
33-
34- - name : Generate Doxygen documentation
35- run : docker run --rm -v ${{ github.workspace }}:/cpp_tutorials mycpp_image:latest doxygen /cpp_tutorials/Doxyfile
36-
37- # Verify if documentation files are generated
38- - name : List documentation directory contents
39- run : docker run --rm -v ${{ github.workspace }}:/cpp_tutorials mycpp_image:latest ls -la /cpp_tutorials/docs
40-
41- # Upload documentation as an artifact (if the files exist)
42- - name : Upload documentation
43- uses : actions/upload-artifact@v3
44- with :
45- name : cpp_documentation
46- path : /cpp_tutorials/docs # This path must exist or be adjusted
47-
48- # Upload build artifacts as an artifact (if the files exist)
4930 - name : Upload build artifacts
5031 uses : actions/upload-artifact@v3
5132 with :
5233 name : cpp_build_output
53- path : /cpp_tutorials/build # This path must exist or be adjusted
34+ path : /cpp_tutorials/build
5435
5536 release :
5637 needs : build
@@ -66,28 +47,18 @@ jobs:
6647 env :
6748 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6849 with :
69- tag_name : ${{ github.ref_name }}
70- release_name : Release ${{ github.ref_name }}
50+ tag_name : ${{ github.ref_name }} # This will use the pushed tag as the release tag
51+ release_name : Release ${{ github.ref_name }} # Name the release after the tag
7152 body : |
72- Release notes for this version.
53+ Release notes for version ${{ github.ref_name }} .
7354 draft : false
7455 prerelease : false
7556
76- # Upload build artifacts to the release
7757 - name : Upload build artifacts to release
7858 uses : actions/upload-release-asset@v1
7959 with :
8060 upload_url : ${{ steps.create_release.outputs.upload_url }}
81- asset_path : /cpp_tutorials/build/your_build_artifact # Adjust to your actual file
82- asset_name : your_build_artifact_name # Adjust this to name the artifact file
61+ asset_path : /cpp_tutorials/build/your_build_artifact
62+ asset_name : your_build_artifact_name
8363 asset_content_type : application/octet-stream
8464
85- # Upload documentation to the release
86- - name : Upload documentation to release
87- uses : actions/upload-release-asset@v1
88- with :
89- upload_url : ${{ steps.create_release.outputs.upload_url }}
90- asset_path : /cpp_tutorials/docs
91- asset_name : cpp_documentation
92- asset_content_type : application/zip
93-
0 commit comments