diff --git a/.ci/azure-pipelines/matrix.yml b/.ci/azure-pipelines/matrix.yml index 91c57e6e3c..8af851e0f5 100644 --- a/.ci/azure-pipelines/matrix.yml +++ b/.ci/azure-pipelines/matrix.yml @@ -11,8 +11,8 @@ parameters: CC: gcc-8 FC: gfortran-8 macOS: - CC: gcc-8 - FC: gfortran-8 + CC: gcc-9 + FC: gfortran-9 Windows: CC: gcc FC: gfortran @@ -25,6 +25,8 @@ parameters: NESTING: basic GRIB1: 0 GRIB2: 1 + + RELEASE: false # Loop/matrix parameters. # Note that these may be overridden by the including yml (typically azure-pipelines.yml). @@ -43,6 +45,7 @@ jobs: - ${{ if not(and(eq(OS_NAME, 'Windows'), eq(BUILD_SYSTEM, 'Make'))) }}: - template: ${{ parameters.templates[OS_NAME] }} parameters: + RELEASE: ${{ parameters.RELEASE }} OS_NAME: ${{ OS_NAME }} BUILD_SYSTEM: ${{ BUILD_SYSTEM }} BUILD_TYPE: ${{ BUILD_TYPE }} diff --git a/.ci/azure-pipelines/release.yml b/.ci/azure-pipelines/release.yml new file mode 100644 index 0000000000..a51ae6fee0 --- /dev/null +++ b/.ci/azure-pipelines/release.yml @@ -0,0 +1,47 @@ +steps: +- ${{ if eq(parameters.OS_NAME, 'Windows') }}: + - task: ArchiveFiles@2 + inputs: + rootFolderOrFile: build/install + includeRootFolder: false + archiveType: zip + archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.SourceBranchName)-$(NESTING)_nesting-$(MODE)-x64-$(OS_NAME)-$(BUILD_TYPE).zip' + displayName: Create distribution package + +- ${{ if not(eq(parameters.OS_NAME, 'Windows')) }}: + - bash: bash .ci/unix/delocate.sh + displayName: Delocate + + - task: ArchiveFiles@2 + inputs: + rootFolderOrFile: build/install + includeRootFolder: false + archiveType: tar + tarCompression: xz + archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.SourceBranchName)-$(NESTING)_nesting-$(MODE)-x64-$(OS_NAME)-$(BUILD_TYPE).tar.xz' + displayName: Create distribution package + +- pwsh: | + dir $(Build.ArtifactStagingDirectory) -r | % { if ($_.Name -cne $_.Name.ToLower()) { ren $_.FullName $_.Name.ToLower() } } + displayName: Rename to lowercase + +# not strictly needed +- task: PublishBuildArtifacts@1 + displayName: Store distribution package + inputs: + pathtoPublish: $(Build.ArtifactStagingDirectory) + artifactName: dist_$(OS_NAME)_$(BUILD_SYSTEM)_$(BUILD_TYPE)_$(MODE) + +- task: GithubRelease@0 + displayName: Create GitHub Draft Release + inputs: + gitHubConnection: WRF-CMake-releases + repositoryName: WRF-CMake/WRF + action: edit # will create if not existing + tag: $(Build.SourceBranchName) + isDraft: true + isPreRelease: true + addChangeLog: false + assetUploadMode: replace + assets: | + $(Build.ArtifactStagingDirectory)/* diff --git a/.ci/azure-pipelines/unix.yml b/.ci/azure-pipelines/unix.yml index 3021f99833..cc3d8882d0 100644 --- a/.ci/azure-pipelines/unix.yml +++ b/.ci/azure-pipelines/unix.yml @@ -31,3 +31,8 @@ jobs: - ${{ if eq(parameters.WATS_RUN, 'true') }}: - template: wats_run.yml + + - ${{ if eq(parameters.RELEASE, 'true') }}: + - template: release.yml + parameters: + ${{ insert }}: ${{ parameters }} diff --git a/.ci/azure-pipelines/windows.yml b/.ci/azure-pipelines/windows.yml index b5e42feb22..e8f620449a 100644 --- a/.ci/azure-pipelines/windows.yml +++ b/.ci/azure-pipelines/windows.yml @@ -46,3 +46,8 @@ jobs: - ${{ if eq(parameters.WATS_RUN, 'true') }}: - template: wats_run.yml + + - ${{ if eq(parameters.RELEASE, 'true') }}: + - template: release.yml + parameters: + ${{ insert }}: ${{ parameters }} \ No newline at end of file diff --git a/.ci/unix/Brewfile b/.ci/unix/Brewfile index 1b3ca7bb02..d5c21ded8c 100644 --- a/.ci/unix/Brewfile +++ b/.ci/unix/Brewfile @@ -1,5 +1,5 @@ brew "coreutils" -brew "gcc@8" +brew "gcc" brew "netcdf" brew "jasper" brew "libpng" diff --git a/.ci/unix/delocate.sh b/.ci/unix/delocate.sh new file mode 100644 index 0000000000..181d3e34ec --- /dev/null +++ b/.ci/unix/delocate.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Copyright 2018 M. Riechert and D. Meyer. Licensed under the MIT License. + +set -ex + +SCRIPTDIR=$(dirname "$0") +cd $SCRIPTDIR/../.. + +if [ "$(uname)" == "Darwin" ]; then + + pip3 install delocate + delocate-listdeps --all --depending build/install/main + delocate-path build/install/main + delocate-listdeps --all --depending build/install/main + +else + echo "Unknown OS: $(uname)" + exit 1 +fi \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index dde37c3e5b..e840675011 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,8 +37,8 @@ jobs: env: - BUILD_SYSTEM=Make - BUILD_TYPE=Debug - - CC=gcc-8 # GNU via Homebrew - - FC=gfortran-8 + - CC=gcc-9 # GNU via Homebrew + - FC=gfortran-9 - MODE=serial - stage: build @@ -48,8 +48,8 @@ jobs: env: - BUILD_SYSTEM=Make - BUILD_TYPE=Debug - - CC=gcc-8 # GNU via Homebrew - - FC=gfortran-8 + - CC=gcc-9 # GNU via Homebrew + - FC=gfortran-9 - MODE=dmpar # CMake builds @@ -89,8 +89,8 @@ jobs: env: - BUILD_SYSTEM=CMake - BUILD_TYPE=Debug - - CC=gcc-8 # GNU via Homebrew - - FC=gfortran-8 + - CC=gcc-9 # GNU via Homebrew + - FC=gfortran-9 - GRIB1=1 - GRIB2=1 - MODE=serial @@ -104,7 +104,7 @@ jobs: - BUILD_SYSTEM=CMake - BUILD_TYPE=Debug - CC=clang # Apple Clang - - FC=gfortran-8 + - FC=gfortran-9 - GRIB1=1 - GRIB2=1 - MODE=dmpar diff --git a/azure-pipelines-release.yml b/azure-pipelines-release.yml new file mode 100644 index 0000000000..955ec1951f --- /dev/null +++ b/azure-pipelines-release.yml @@ -0,0 +1,19 @@ +# First, create a tag for the new version. +# Then, run this pipeline on the tag to store binaries in a draft GitHub release. + +# Note that these values are also overridden to "none" in Azure DevOps's UI to +# prevent others to run this pipeline by changing the triggers below and opening a PR. +# It still wouldn't cause harm as secrets (GitHub credentials) are not available to PRs from forks. +trigger: none +pr: none + +jobs: +- template: .ci/azure-pipelines/matrix.yml + parameters: + OS_NAMES: [Windows, macOS] # TODO Linux + BUILD_SYSTEMS: [CMake] + BUILD_TYPES: [Debug, Release] + MODES: [serial, dmpar] + WATS_DIFF: false + WATS_PLOTS: false + RELEASE: true