1515 build :
1616 if : github.event_name != 'push' || (!startsWith(github.ref, 'refs/tags/'))
1717 runs-on : ubuntu-latest
18+ outputs :
19+ built : ${{ steps.check_output.outcome }}
1820 steps :
1921 - uses : actions/checkout@v4
2022
@@ -27,39 +29,38 @@ jobs:
2729 cache : true
2830
2931 - name : Configure CMake
30- run : cmake -B ${{ github.workspace }}/ build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
32+ run : cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
3133
3234 - name : Build
33- run : cmake --build ${{ github.workspace }}/ build --config ${{ env.BUILD_TYPE }}
35+ run : cmake --build build --config ${{ env.BUILD_TYPE }}
3436
3537 - name : Test
36- working-directory : ${{ github.workspace }}/ build
38+ working-directory : build
3739 run : ctest -C ${{ env.BUILD_TYPE }}
3840
41+ - name : Upload build artifact
42+ if : startsWith(github.ref, 'refs/tags/v')
43+ uses : actions/upload-artifact@v4
44+ with :
45+ name : memsc-artifacts
46+ path : |
47+ build/memsc
3948 release :
4049 if : startsWith(github.ref, 'refs/tags/v')
50+ needs : build
4151 runs-on : ubuntu-latest
4252 steps :
4353 - uses : actions/checkout@v4
4454
45- - name : Install Qt via install-qt-action
46- uses : jurplel/install-qt-action @v4
55+ - name : Download build artifact
56+ uses : actions/download-artifact @v4
4757 with :
48- version : ' 6.9'
49- host : linux
50- target : desktop
51- cache : true
52-
53- - name : Configure CMake
54- run : cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
55-
56- - name : Build
57- run : cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }}
58+ name : memsc-artifacts
5859
5960 - name : Package artifacts
6061 run : |
6162 mkdir -p release
62- cp ${{ github.workspace }}/build/ memsc release/ || echo "Warning: memsc not found"
63+ cp memsc release/ || echo "Warning: memsc not found"
6364 tar czf memsc-${{ github.ref_name }}.tar.gz release
6465
6566 - name : Create GitHub Release
7475 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7576
7677 - name : Upload Release Asset
77- uses : actions/upload-release-asset@v1
78+ uses : softprops/action-gh-release@v2
7879 with :
79- upload_url : ${{ steps.create_release.outputs.upload_url }}
80- asset_path : memsc-${{ github.ref_name }}.tar.gz
81- asset_name : memsc-${{ github.ref_name }}.tar.gz
82- asset_content_type : application/gzip
80+ files : memsc-${{ github.ref_name }}.tar.gz
8381 env :
8482 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments