Updated version #10
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
name: Release Management | |
on: push | |
env: | |
RELEASE_VERSION: 8.0.0-turbo | |
jobs: | |
build_and_upload: | |
name: Build SU2 | |
strategy: | |
fail-fast: false | |
matrix: | |
os_bin: [macos64, macos64-mpi, linux64, linux64-mpi, win64, win64-mpi] | |
include: | |
- os_bin: win64 | |
flags: '-Dwith-mpi=disabled --cross-file=/hostfiles/hostfile_windows' | |
- os_bin: win64-mpi | |
flags: '-Dcustom-mpi=true --cross-file=/hostfiles/hostfile_windows_mpi' | |
- os_bin: macos64 | |
flags: '-Dwith-mpi=disabled --cross-file=/hostfiles/hostfile_darwin' | |
- os_bin: macos64-mpi | |
flags: '-Dcustom-mpi=true --cross-file=/hostfiles/hostfile_darwin_mpi' | |
- os_bin: linux64 | |
flags: '-Dwith-mpi=disabled -Dstatic-cgns-deps=true --cross-file=/hostfiles/hostfile_linux' | |
- os_bin: linux64-mpi | |
flags: '-Dcustom-mpi=true --cross-file=/hostfiles/hostfile_linux_mpi' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cache Object Files | |
uses: actions/cache@v3 | |
with: | |
path: ccache | |
key: ${{ matrix.os_bin }}-${{ github.sha }} | |
restore-keys: ${{ matrix.os_bin }} | |
- name: Build | |
uses: docker://ghcr.io/su2code/su2/build-su2-cross:230813-0103 | |
with: | |
args: -b ${{ github.sha }} -f "${{matrix.flags}}" | |
- name: Create Archive | |
run: | | |
cd install | |
zip -r ../${{matrix.os_bin}}.zip bin/* | |
- name: Check if release exists | |
id: check_release | |
run: | | |
release_tag=$(git describe --tags --exact-match 2>/dev/null || true) | |
if [[ -z "$release_tag" ]]; then | |
echo "::set-output name=exists::false" | |
else | |
echo "::set-output name=exists::true" | |
fi | |
- name: Create Release | |
if: steps.check_release.outputs.exists == 'false' | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{env.RELEASE_VERSION}}-${{matrix.os_bin}} | |
release_name: ${{env.RELEASE_VERSION}}-${{matrix.os_bin}} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ${{matrix.os_bin}}.zip | |
asset_name: SU2-v${{env.RELEASE_VERSION}}-${{matrix.os_bin}}.zip | |
asset_content_type: application/zip |