@@ -15,18 +15,42 @@ jobs:
1515 runs-on : ubuntu-22.04
1616
1717 steps :
18+ # Step 1: Checkout the repository
1819 - uses : actions/checkout@v3
1920 name : Checkout the repository
2021
22+ # Step 2: Build the Docker image
2123 - name : Build the Docker image
2224 run : docker build . --file Dockerfile --tag mycpp_image:latest
2325
26+ # Step 3: Configure CMake
2427 - name : Configure CMake
2528 run : docker run --rm -v ${{ github.workspace }}:/cpp_tutorials mycpp_image:latest cmake -S /cpp_tutorials -G "Ninja Multi-Config" -B /cpp_tutorials/build
2629
30+ # Step 4: Build with CMake
2731 - name : Build with CMake
2832 run : docker run --rm -v ${{ github.workspace }}:/cpp_tutorials mycpp_image:latest cmake --build /cpp_tutorials/build --config Release
2933
34+ # Step 5: Generate Doxygen documentation
35+ - name : Generate Doxygen documentation
36+ run : docker run --rm -v ${{ github.workspace }}:/cpp_tutorials mycpp_image:latest doxygen /cpp_tutorials/Doxyfile
37+
38+ # Verify if build files are generated
39+ - name : List build directory contents
40+ run : docker run --rm -v ${{ github.workspace }}:/cpp_tutorials mycpp_image:latest ls -la /cpp_tutorials/build
41+
42+ # Verify if documentation files are generated
43+ - name : List documentation directory contents
44+ run : docker run --rm -v ${{ github.workspace }}:/cpp_tutorials mycpp_image:latest ls -la /cpp_tutorials/docs
45+
46+ # Upload documentation as an artifact (if the files exist)
47+ - name : Upload documentation
48+ uses : actions/upload-artifact@v3
49+ with :
50+ name : cpp_documentation
51+ path : /cpp_tutorials/docs
52+
53+ # Upload build artifacts as an artifact (if the files exist)
3054 - name : Upload build artifacts
3155 uses : actions/upload-artifact@v3
3256 with :
@@ -38,27 +62,39 @@ jobs:
3862 runs-on : ubuntu-22.04
3963
4064 steps :
65+ # Step 1: Checkout the repository
4166 - uses : actions/checkout@v3
4267 name : Checkout the repository
4368
69+ # Step 2: Create a GitHub release using PAT_TOKEN
4470 - name : Create Release
4571 id : create_release
4672 uses : actions/create-release@v1
4773 env :
48- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
74+ GITHUB_TOKEN : ${{ secrets.PAT_TOKEN }} # Use Personal Access Token (PAT)
4975 with :
50- tag_name : ${{ github.ref_name }} # This will use the pushed tag as the release tag
76+ tag_name : ${{ github.ref_name }} # Use the pushed tag as the release tag
5177 release_name : Release ${{ github.ref_name }} # Name the release after the tag
5278 body : |
5379 Release notes for version ${{ github.ref_name }}.
5480 draft : false
5581 prerelease : false
5682
83+ # Step 3: Upload build artifacts to the release
5784 - name : Upload build artifacts to release
5885 uses : actions/upload-release-asset@v1
5986 with :
6087 upload_url : ${{ steps.create_release.outputs.upload_url }}
61- asset_path : /cpp_tutorials/build/your_build_artifact
62- asset_name : your_build_artifact_name
88+ asset_path : /cpp_tutorials/build/your_build_artifact # Adjust to your actual file
89+ asset_name : your_build_artifact_name # Adjust this to name the artifact file
6390 asset_content_type : application/octet-stream
6491
92+ # Step 4: Upload documentation to the release
93+ - name : Upload documentation to release
94+ uses : actions/upload-release-asset@v1
95+ with :
96+ upload_url : ${{ steps.create_release.outputs.upload_url }}
97+ asset_path : /cpp_tutorials/docs
98+ asset_name : cpp_documentation
99+ asset_content_type : application/zip
100+
0 commit comments