From 66db00d0ef88027c7882085c455f509429132624 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Sun, 24 Mar 2024 20:10:09 -0500 Subject: [PATCH] Rework snapshots/release workflows for consistent args (#4227) --- .github/workflows/abi-report.yml | 2 +- .github/workflows/cmake-bintest.yml | 12 --------- .github/workflows/cmake-ctest.yml | 41 ++++++++++++++++------------- .github/workflows/daily-build.yml | 8 +++--- .github/workflows/release-files.yml | 28 ++++++++++---------- .github/workflows/release.yml | 9 ++++--- .github/workflows/remove-files.yml | 1 + .github/workflows/tarball.yml | 26 ++++++++++-------- 8 files changed, 63 insertions(+), 64 deletions(-) diff --git a/.github/workflows/abi-report.yml b/.github/workflows/abi-report.yml index e3bf26917f2..01a72106711 100644 --- a/.github/workflows/abi-report.yml +++ b/.github/workflows/abi-report.yml @@ -178,4 +178,4 @@ jobs: with: name: abi-reports path: | - ${{ runner.workspace }}/buildabi/${{ inputs.file_base }}.html.abi.reports + ${{ runner.workspace }}/buildabi/${{ inputs.file_base }}.html.abi.reports.tar.gz diff --git a/.github/workflows/cmake-bintest.yml b/.github/workflows/cmake-bintest.yml index ffc2c5be0db..f7c01b71ae7 100644 --- a/.github/workflows/cmake-bintest.yml +++ b/.github/workflows/cmake-bintest.yml @@ -129,12 +129,6 @@ jobs: run: | ls -l ${{ github.workspace }}/HDF_Group/HDF5 - - name: Set file base name (Linux) - id: set-file-base - run: | - FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") - echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT - - name: List files for the space (Linux) run: | ls -l ${{ github.workspace }} @@ -187,12 +181,6 @@ jobs: run: | ls -l ${{ github.workspace }}/HDF_Group/HDF5 - - name: Set file base name (MacOS) - id: set-file-base - run: | - FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") - echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT - - name: List files for the space (MacOS) run: | ls ${{ github.workspace }} diff --git a/.github/workflows/cmake-ctest.yml b/.github/workflows/cmake-ctest.yml index 20699b39fc1..99bd7a87d7a 100644 --- a/.github/workflows/cmake-ctest.yml +++ b/.github/workflows/cmake-ctest.yml @@ -4,6 +4,11 @@ name: hdf5 1.14 ctest runs on: workflow_call: inputs: + snap_name: + description: 'The name in the source tarballs' + type: string + required: false + default: hdfsrc file_base: description: "The common base name of the source tarballs" required: true @@ -46,11 +51,11 @@ jobs: run: | FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT - if [[ '${{ inputs.use_environ }}' == 'snapshots' ]] + if [[ '${{ inputs.use_environ }}' == 'release' ]] then - SOURCE_NAME_BASE=$(echo "hdfsrc") + SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}") else - SOURCE_NAME_BASE=$(echo "$FILE_NAME_BASE") + SOURCE_NAME_BASE=$(echo "hdfsrc") fi echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT shell: bash @@ -129,11 +134,11 @@ jobs: run: | FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT - if [[ '${{ inputs.use_environ }}' == 'snapshots' ]] + if [[ '${{ inputs.use_environ }}' == 'release' ]] then - SOURCE_NAME_BASE=$(echo "hdfsrc") + SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}") else - SOURCE_NAME_BASE=$(echo "$FILE_NAME_BASE") + SOURCE_NAME_BASE=$(echo "hdfsrc") fi echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT @@ -253,11 +258,11 @@ jobs: run: | FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT - if [[ '${{ inputs.use_environ }}' == 'snapshots' ]] + if [[ '${{ inputs.use_environ }}' == 'release' ]] then - SOURCE_NAME_BASE=$(echo "hdfsrc") + SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}") else - SOURCE_NAME_BASE=$(echo "$FILE_NAME_BASE") + SOURCE_NAME_BASE=$(echo "hdfsrc") fi echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT @@ -333,11 +338,11 @@ jobs: run: | FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT - if [[ '${{ inputs.use_environ }}' == 'snapshots' ]] + if [[ '${{ inputs.use_environ }}' == 'release' ]] then - SOURCE_NAME_BASE=$(echo "hdfsrc") + SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}") else - SOURCE_NAME_BASE=$(echo "$FILE_NAME_BASE") + SOURCE_NAME_BASE=$(echo "hdfsrc") fi echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT @@ -413,11 +418,11 @@ jobs: run: | FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT - if [[ '${{ inputs.use_environ }}' == 'snapshots' ]] + if [[ '${{ inputs.use_environ }}' == 'release' ]] then - SOURCE_NAME_BASE=$(echo "hdfsrc") + SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}") else - SOURCE_NAME_BASE=$(echo "$FILE_NAME_BASE") + SOURCE_NAME_BASE=$(echo "hdfsrc") fi echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT shell: bash @@ -507,11 +512,11 @@ jobs: run: | FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT - if [[ '${{ inputs.use_environ }}' == 'snapshots' ]] + if [[ '${{ inputs.use_environ }}' == 'release' ]] then - SOURCE_NAME_BASE=$(echo "hdfsrc") + SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}") else - SOURCE_NAME_BASE=$(echo "$FILE_NAME_BASE") + SOURCE_NAME_BASE=$(echo "hdfsrc") fi echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT diff --git a/.github/workflows/daily-build.yml b/.github/workflows/daily-build.yml index ae856fbf0b6..d648be25dff 100644 --- a/.github/workflows/daily-build.yml +++ b/.github/workflows/daily-build.yml @@ -42,10 +42,10 @@ jobs: needs: call-workflow-tarball uses: ./.github/workflows/cmake-ctest.yml with: - file_base: ${{ needs.call-workflow-tarball.outputs.file_base }} preset_name: ci-StdShar - #use_tag: snapshot-1.14 - #use_environ: snapshots + file_base: ${{ needs.call-workflow-tarball.outputs.file_base }} + use_tag: snapshot-1.14 + use_environ: snapshots if: ${{ needs.call-workflow-tarball.outputs.has_changes == 'true' }} call-workflow-abi: @@ -63,7 +63,7 @@ jobs: permissions: contents: write # In order to allow tag creation uses: ./.github/workflows/release-files.yml - with: + thub/workflows/daily-build.ymlwith: file_base: ${{ needs.call-workflow-tarball.outputs.file_base }} file_branch: ${{ needs.call-workflow-tarball.outputs.file_branch }} file_sha: ${{ needs.call-workflow-tarball.outputs.file_sha }} diff --git a/.github/workflows/release-files.yml b/.github/workflows/release-files.yml index ce01c53a76b..fbd04ef82bb 100644 --- a/.github/workflows/release-files.yml +++ b/.github/workflows/release-files.yml @@ -149,18 +149,18 @@ jobs: - name: Create sha256 sums for files run: | - sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}.doxygen.zip > sha256sums.txt - sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}.tar.gz >> sha256sums.txt - sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}.zip >> sha256sums.txt - sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-osx12.tar.gz >> sha256sums.txt - sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc.tar.gz >> sha256sums.txt - sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc.deb >> sha256sums.txt - sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc.rpm >> sha256sums.txt - sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc_s3.tar.gz >> sha256sums.txt - sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_cl.zip >> sha256sums.txt - sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_intel.tar.gz >> sha256sums.txt - sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_intel.zip >> sha256sums.txt - sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}.html.abi.reports.tar.gz >> sha256sums.txt + sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}.doxygen.zip > ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt + sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}.tar.gz >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt + sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}.zip >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt + sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-osx12.tar.gz >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt + sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc.tar.gz >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt + sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc.deb >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt + sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc.rpm >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt + sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc_s3.tar.gz >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt + sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_cl.zip >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt + sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_intel.tar.gz >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt + sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_intel.zip >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt + sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}.html.abi.reports.tar.gz >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt - name: Store snapshot name run: | @@ -198,7 +198,7 @@ jobs: ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_intel.tar.gz ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_intel.zip ${{ steps.get-file-base.outputs.FILE_BASE }}.html.abi.reports.tar.gz - sha256sums.txt + ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` - name: Release tag @@ -222,7 +222,7 @@ jobs: ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_intel.tar.gz ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_intel.zip ${{ steps.get-file-base.outputs.FILE_BASE }}.html.abi.reports.tar.gz - sha256sums.txt + ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` - name: List files for the space (Linux) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef87476627e..4c52077ebe5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,15 +31,16 @@ jobs: needs: log-the-inputs uses: ./.github/workflows/tarball.yml with: - use_tag: ${{ inputs.use_tag }} + use_tag: ${{ needs.log-the-inputs.outputs.rel_tag }} use_environ: release call-workflow-ctest: needs: call-workflow-tarball uses: ./.github/workflows/cmake-ctest.yml with: - file_base: ${{ needs.call-workflow-tarball.outputs.file_base }} preset_name: ci-StdShar + file_base: ${{ needs.call-workflow-tarball.outputs.file_base }} + snap_name: hdf5-${{ needs.call-workflow-tarball.outputs.source_base }} use_environ: release call-workflow-abi: @@ -58,8 +59,8 @@ jobs: uses: ./.github/workflows/release-files.yml with: file_base: ${{ needs.call-workflow-tarball.outputs.file_base }} - file_branch: ${{ needs.log-the-inputs.outputs.rel_tag }} - file_sha: ${{ needs.log-the-inputs.outputs.rel_tag }} + file_branch: ${{ needs.call-workflow-tarball.outputs.file_branch }} + file_sha: ${{ needs.call-workflow-tarball.outputs.file_sha }} use_tag: ${{ needs.log-the-inputs.outputs.rel_tag }} use_environ: release diff --git a/.github/workflows/remove-files.yml b/.github/workflows/remove-files.yml index 464cf973447..cc4e44ee38d 100644 --- a/.github/workflows/remove-files.yml +++ b/.github/workflows/remove-files.yml @@ -45,6 +45,7 @@ jobs: token: ${{ github.token }} tag: "${{ inputs.use_tag }}" assets: | + ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt ${{ steps.get-file-base.outputs.FILE_BASE }}.html.abi.reports.tar.gz ${{ steps.get-file-base.outputs.FILE_BASE }}.doxygen.zip ${{ steps.get-file-base.outputs.FILE_BASE }}.tar.gz diff --git a/.github/workflows/tarball.yml b/.github/workflows/tarball.yml index 09ab2b53201..a5c8e190ce4 100644 --- a/.github/workflows/tarball.yml +++ b/.github/workflows/tarball.yml @@ -18,6 +18,9 @@ on: has_changes: description: "Whether there were changes the previous day" value: ${{ jobs.check_commits.outputs.has_changes }} + source_base: + description: "The common base name of the source tarballs" + value: ${{ jobs.create_tarball.outputs.source_base }} file_base: description: "The common base name of the source tarballs" value: ${{ jobs.create_tarball.outputs.file_base }} @@ -80,6 +83,7 @@ jobs: if: ${{ ((inputs.use_environ == 'snapshots') && (needs.check_commits.outputs.has_changes == 'true')) || (inputs.use_environ == 'release') }} outputs: file_base: ${{ steps.set-file-base.outputs.FILE_BASE }} + source_base: ${{ steps.version.outputs.SOURCE_TAG }} steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - name: Get Sources @@ -96,20 +100,20 @@ jobs: id: version run: | cd "$GITHUB_WORKSPACE/hdfsrc" - echo "TAG_VERSION=$(bin/h5vers)" >> $GITHUB_OUTPUT + echo "SOURCE_TAG=$(bin/h5vers)" >> $GITHUB_OUTPUT - name: Set file base name id: set-file-base run: | - if [[ '${{ inputs.use_environ }}' == 'snapshots' && '${{ needs.check_commits.outputs.has_changes }}' == 'true' ]] + if [[ '${{ inputs.use_environ }}' == 'snapshots' ]] then FILE_NAME_BASE=$(echo "hdf5-${{ needs.check_commits.outputs.branch_ref }}-${{ needs.check_commits.outputs.branch_sha }}") else if [[ '${{ inputs.use_tag }}' == 'snapshot' ]] then - FILE_NAME_BASE=$(echo "${{ inputs.use_tag }}") + FILE_NAME_BASE=$(echo "snapshot") else - FILE_NAME_BASE=$(echo "hdf5-${{ steps.version.outputs.TAG_VERSION }}") + FILE_NAME_BASE=$(echo "hdf5-${{ steps.version.outputs.SOURCE_TAG }}") fi fi echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT @@ -117,7 +121,7 @@ jobs: - name: Create snapshot file base name id: create-file-base - if: ${{ (inputs.use_environ == 'snapshots') && (needs.check_commits.outputs.has_changes == 'true') }} + if: ${{ (inputs.use_environ == 'snapshots') }} run: | cd "$GITHUB_WORKSPACE/hdfsrc" bin/release -d $GITHUB_WORKSPACE --branch ${{ needs.check_commits.outputs.branch_ref }} --revision gzip zip @@ -125,18 +129,18 @@ jobs: - name: Create release file base name id: create-rel-base - if: ${{ (inputs.use_environ == 'release') && (inputs.use_tag != 'snapshot') }} + if: ${{ (inputs.use_environ == 'release') }} run: | cd "$GITHUB_WORKSPACE/hdfsrc" bin/release -d $GITHUB_WORKSPACE gzip zip shell: bash - - name: Create snapshot file base name - id: create-snap-base - if: ${{ (inputs.use_tag == 'snapshot') && (inputs.use_environ == 'release') }} + - name: Rename release file base name + id: ren-basename + if: ${{ (inputs.use_environ == 'release') && (inputs.use_tag == 'snapshot') }} run: | - cd "$GITHUB_WORKSPACE/hdfsrc" - bin/release -d $GITHUB_WORKSPACE --branch ${{ inputs.use_tag }} gzip zip + mv hdf5-${{ steps.version.outputs.SOURCE_TAG }}.tar.gz ${{ inputs.use_tag }}.tar.gz + mv hdf5-${{ steps.version.outputs.SOURCE_TAG }}.zip ${{ inputs.use_tag }}.zip shell: bash - name: List files in the repository