@@ -26,18 +26,18 @@ jobs:
2626 compiler : gcc
2727 compilerpp : g++
2828 package_suffix : ' deb'
29- - os : ' macos-latest'
30- compiler : gcc
31- compilerpp : g++
32- package_suffix : ' dmg'
29+ # - os: 'macos-latest'
30+ # compiler: gcc
31+ # compilerpp: g++
32+ # package_suffix: 'dmg'
3333 steps :
3434 - uses : actions/checkout@v2
3535
3636 - name : Install Dependencies ( Ubuntu 20.04)
3737 run : |
3838 sudo apt-get update
3939 #sudo apt-get upgrade
40- sudo apt-get install -y g++ cmake clang cppcheck similarity-tester flawfinder
40+ sudo apt-get install -y g++ cmake clang cppcheck similarity-tester flawfinder p7zip-full openssl
4141 sudo apt-get install -y lcov htmldoc poppler-utils graphviz doxygen
4242 sudo apt-get install -y libtbb*-dev libocct-*-dev occt-misc python3-dev python3-pybind11 libboost-dev freecad
4343 sudo apt-get install -y libx11-dev libxmu-dev libxi-dev
5454 sudo apt-get install -y libx11-dev libxmu-dev libxi-dev
5555 if : matrix.os == 'ubuntu-18.04'
5656
57+ - name : zip source code for release
58+ run : |
59+ cd ..
60+ ls
61+ 7z a -r ${{ env.PROJECT_NAME }}.zip ${{ env.PROJECT_NAME }}
62+ mv ${{ env.PROJECT_NAME }}.zip ${{ github.workspace }}/
63+ cd ${{ github.workspace }}
64+ sha256sum ${{ env.PROJECT_NAME }}.zip | awk '{ print $1; }' > ${{ github.workspace }}/${{ env.PROJECT_NAME }}.zip.sha256.txt
65+ if : matrix.os == 'ubuntu-20.04'
66+
5767 - name : Compile on Linux (debug)
5868 # env:
5969 # CC: ${{ matrix.compiler }}
6474 cd build
6575 cmake -DCODE_COVERAGE=ON -DPython_EXECUTABLE=$(which python3) -DPPP_VERSION_NAME=${{ env.PROJECT_VERSION }} .. -Wno-dev
6676 make 2>&1 | tee clang_tidy_build_results.log
67- # packup source code into zip and show in release : https://github.com/ukaea/parallel-preprocessor/archive/dev.zip
6877 if : matrix.os == 'ubuntu-20.04'
6978
7079 - name : Compile on Linux (release)
@@ -141,6 +150,32 @@ jobs:
141150 overwrite : true
142151 prerelease : true
143152 if : github.ref == 'refs/heads/main' # only upload package on main branch, not PR, forks, which has no write access
153+
154+ # ################## zip and upload source code zip ##########################
155+ # those release asset filename endpoint (not necessarily created before this upload)
156+ - name : Upload source code to release
157+ uses : svenstaro/upload-release-action@v2
158+ with :
159+ repo_token : ${{ secrets.GITHUB_TOKEN }}
160+ file : ${{ github.workspace }}/${{ env.PROJECT_NAME }}.zip
161+ asset_name : ${{ env.PROJECT_NAME }}.zip
162+ tag : dev
163+ overwrite : true
164+ prerelease : true
165+ if : github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-20.04'
166+
167+ - name : Upload source code checksum
168+ uses : svenstaro/upload-release-action@v2
169+ with :
170+ repo_token : ${{ secrets.GITHUB_TOKEN }}
171+ file : ${{ github.workspace }}/${{ env.PROJECT_NAME }}.zip.sha256.txt
172+ asset_name : ${{ env.PROJECT_NAME }}.zip.sha256.txt
173+ tag : dev
174+ overwrite : true
175+ prerelease : true
176+ if : github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-20.04'
177+ # only upload package on main branch, not PR, forks, which has no write access
178+ # https://github.com/ukaea/parallel-preprocessor/releases/download/dev/parallel-preprocessor.zip
144179
145180 # ######################################### only for Ubuntu debug release ############################################
146181 - name : Run Cpp Check Flawfinder Sim C++ ( Ubuntu GCC Dev/Master )
@@ -191,6 +226,7 @@ jobs:
191226 if : matrix.os == 'ubuntu-20.04' && ( github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' )
192227
193228 - name : Build Website Files ( Ubuntu GCC Dev/Master )
229+ working-directory : ${{ github.workspace }}
194230 run : |
195231 python scripts/site_generation.py build/clang_tidy_build_results.log build/flawfinder.log build/sim_cpp.log
196232 git add -f site/*.html
@@ -203,4 +239,4 @@ jobs:
203239 github_token : ${{ secrets.GITHUB_TOKEN }}
204240 branch : gh-pages
205241 force : true
206- if : matrix.os == 'ubuntu-20.04' && ( github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' )
242+ if : matrix.os == 'ubuntu-20.04' && ( github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' )
0 commit comments