Skip to content

Commit

Permalink
Merge HDF4 release workflow changes to hdf5 (HDFGroup#4093)
Browse files Browse the repository at this point in the history
  • Loading branch information
byrnHDF authored and lrknox committed Mar 21, 2024
1 parent 1e95992 commit 4b596bc
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 102 deletions.
70 changes: 59 additions & 11 deletions .github/workflows/cmake-ctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ on:
description: "The common base name of the preset configuration name to control the build"
required: true
type: string
use_environ:
description: 'Environment to locate files'
type: string
required: true
default: snapshots

permissions:
contents: read
Expand Down Expand Up @@ -41,6 +46,13 @@ jobs:
run: |
FILE_NAME_BASE=$(echo "${{ inputs.file_base }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
if [[ '${{ inputs.use_environ }}' == 'snapshots' ]]
then
SOURCE_NAME_BASE=$(echo "hdfsrc")
else
SOURCE_NAME_BASE=$(echo "$FILE_NAME_BASE")
fi
echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT
shell: bash

# Get files created by release script
Expand All @@ -67,7 +79,7 @@ jobs:

- name: Run ctest (Windows)
run: |
cd "${{ runner.workspace }}/hdf5/hdfsrc"
cd "${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}"
cmake --workflow --preset=${{ inputs.preset_name }}-MSVC --fresh
shell: bash

Expand Down Expand Up @@ -117,6 +129,13 @@ jobs:
run: |
FILE_NAME_BASE=$(echo "${{ inputs.file_base }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
if [[ '${{ inputs.use_environ }}' == 'snapshots' ]]
then
SOURCE_NAME_BASE=$(echo "hdfsrc")
else
SOURCE_NAME_BASE=$(echo "$FILE_NAME_BASE")
fi
echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT
# Get files created by release script
- name: Get tgz-tarball (Linux)
Expand All @@ -135,7 +154,7 @@ jobs:

- name: Run ctest (Linux)
run: |
cd "${{ runner.workspace }}/hdf5/hdfsrc"
cd "${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}"
cmake --workflow --preset=${{ inputs.preset_name }}-GNUC --fresh
shell: bash

Expand All @@ -157,8 +176,8 @@ jobs:
run: |
mkdir "${{ runner.workspace }}/builddeb"
mkdir "${{ runner.workspace }}/builddeb/hdf5"
cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING ${{ runner.workspace }}/builddeb/hdf5
cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING_LBNL_HDF5 ${{ runner.workspace }}/builddeb/hdf5
cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING ${{ runner.workspace }}/builddeb/hdf5
cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 ${{ runner.workspace }}/builddeb/hdf5
cp ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-GNUC/README.md ${{ runner.workspace }}/builddeb/hdf5
cp ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-GNUC/*.deb ${{ runner.workspace }}/builddeb/hdf5
cd "${{ runner.workspace }}/builddeb"
Expand All @@ -170,8 +189,8 @@ jobs:
run: |
mkdir "${{ runner.workspace }}/buildrpm"
mkdir "${{ runner.workspace }}/buildrpm/hdf5"
cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING ${{ runner.workspace }}/buildrpm/hdf5
cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING_LBNL_HDF5 ${{ runner.workspace }}/buildrpm/hdf5
cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING ${{ runner.workspace }}/buildrpm/hdf5
cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 ${{ runner.workspace }}/buildrpm/hdf5
cp ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-GNUC/README.md ${{ runner.workspace }}/buildrpm/hdf5
cp ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-GNUC/*.rpm ${{ runner.workspace }}/buildrpm/hdf5
cd "${{ runner.workspace }}/buildrpm"
Expand Down Expand Up @@ -234,6 +253,13 @@ jobs:
run: |
FILE_NAME_BASE=$(echo "${{ inputs.file_base }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
if [[ '${{ inputs.use_environ }}' == 'snapshots' ]]
then
SOURCE_NAME_BASE=$(echo "hdfsrc")
else
SOURCE_NAME_BASE=$(echo "$FILE_NAME_BASE")
fi
echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT
# Get files created by release script
- name: Get tgz-tarball (MacOS)
Expand Down Expand Up @@ -261,14 +287,13 @@ jobs:
- name: Run ctest (MacOS)
id: run-ctest
run: |
cd "${{ runner.workspace }}/hdf5/hdfsrc"
cd "${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}"
cmake --workflow --preset=${{ inputs.preset_name }}-OSX-Clang --fresh
shell: bash

- name: Publish binary (MacOS)
id: publish-ctest-binary
run: |
mkdir "${{ runner.workspace }}/build114"
mkdir "${{ runner.workspace }}/build114/hdf5"
cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING ${{ runner.workspace }}/build114/hdf5
Expand Down Expand Up @@ -326,7 +351,7 @@ jobs:

- name: Run ctest (Linux S3)
run: |
cd "${{ runner.workspace }}/hdf5/hdfsrc"
cd "${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}"
cmake --workflow --preset=${{ inputs.preset_name }}-GNUC-S3 --fresh
shell: bash

Expand Down Expand Up @@ -381,6 +406,13 @@ jobs:
run: |
FILE_NAME_BASE=$(echo "${{ inputs.file_base }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
if [[ '${{ inputs.use_environ }}' == 'snapshots' ]]
then
SOURCE_NAME_BASE=$(echo "hdfsrc")
else
SOURCE_NAME_BASE=$(echo "$FILE_NAME_BASE")
fi
echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT
shell: bash

# Get files created by release script
Expand Down Expand Up @@ -411,7 +443,7 @@ jobs:
CC: ${{ steps.setup-fortran.outputs.cc }}
CXX: ${{ steps.setup-fortran.outputs.cxx }}
run: |
cd "${{ runner.workspace }}/hdf5/hdfsrc"
cd "${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}"
cmake --workflow --preset=${{ inputs.preset_name }}-win-Intel --fresh
shell: pwsh

Expand All @@ -425,6 +457,15 @@ jobs:
Copy-Item -Path ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-Intel/README.md -Destination ${{ runner.workspace }}/build114/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-Intel/* -Destination ${{ runner.workspace }}/build114/hdf5/ -Include *.zip
cd "${{ runner.workspace }}/build114"
=======
mkdir "${{ runner.workspace }}/build"
mkdir "${{ runner.workspace }}/build/hdf5"
Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING -Destination ${{ runner.workspace }}/build/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 -Destination ${{ runner.workspace }}/build/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-Intel/README.md -Destination ${{ runner.workspace }}/build/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-Intel/* -Destination ${{ runner.workspace }}/build/hdf5/ -Include *.zip
cd "${{ runner.workspace }}/build"
>>>>>>> f87725c... Merge HDF4 release workflow changes to hdf5 (#4093)
7z a -tzip ${{ steps.set-file-base.outputs.FILE_BASE }}-win-vs2022_intel.zip hdf5
shell: pwsh

Expand Down Expand Up @@ -468,6 +509,13 @@ jobs:
run: |
FILE_NAME_BASE=$(echo "${{ inputs.file_base }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
if [[ '${{ inputs.use_environ }}' == 'snapshots' ]]
then
SOURCE_NAME_BASE=$(echo "hdfsrc")
else
SOURCE_NAME_BASE=$(echo "$FILE_NAME_BASE")
fi
echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT
# Get files created by release script
- name: Get tgz-tarball (Linux_intel)
Expand All @@ -490,7 +538,7 @@ jobs:
CC: ${{ steps.setup-fortran.outputs.cc }}
CXX: ${{ steps.setup-fortran.outputs.cxx }}
run: |
cd "${{ runner.workspace }}/hdf5/hdfsrc"
cd "${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}"
cmake --workflow --preset=${{ inputs.preset_name }}-Intel --fresh
shell: bash

Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/release-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ jobs:
with:
fetch-depth: 0

- run: |
git checkout ${{ inputs.file_sha }}
- uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 # v1.7.2
id: "tag_create"
with:
Expand Down Expand Up @@ -183,7 +180,6 @@ jobs:
- name: PreRelease tag
id: create_prerelease
if: ${{ (inputs.use_environ == 'snapshots') }}
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
with:
tag_name: "${{ inputs.use_tag }}"
Expand All @@ -206,30 +202,6 @@ jobs:
sha256sums.txt
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
- name: Release tag
id: create_release
if: ${{ (inputs.use_environ == 'release') }}
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
with:
tag_name: "${{ inputs.use_tag }}"
prerelease: false
body_path: description.txt
files: |
${{ steps.get-file-base.outputs.FILE_BASE }}.doxygen.zip
${{ steps.get-file-base.outputs.FILE_BASE }}.tar.gz
${{ steps.get-file-base.outputs.FILE_BASE }}.zip
${{ steps.get-file-base.outputs.FILE_BASE }}-osx12.tar.gz
${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc.tar.gz
${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc.deb
${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc.rpm
${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc_s3.tar.gz
${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_cl.zip
${{ 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
sha256sums.txt
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
- name: List files for the space (Linux)
run: |
ls -l ${{ github.workspace }}
Expand Down
75 changes: 12 additions & 63 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,88 +27,37 @@ jobs:
TAG: ${{ inputs.use_tag }}
run: echo "RELEASE_TAG=$TAG" >> $GITHUB_OUTPUT

# tarball.yml will be used for releases when pre-tag actions are implemented
# call-workflow-tarball:
# needs: log-the-inputs
# uses: ./.github/workflows/tarball.yml
# with:
# use_tag: ${{ inputs.use_tag }}
# use_environ: release

create-files-ctest:
call-workflow-tarball:
needs: log-the-inputs
runs-on: ubuntu-latest
outputs:
file_base: ${{ steps.set-file-base.outputs.FILE_BASE }}
steps:
- name: Set file base name
id: set-file-base
run: |
FILE_NAME_BASE=$(echo "${{ needs.log-the-inputs.outputs.rel_tag }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
shell: bash

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Get Sources
uses: actions/[email protected]
with:
path: hdfsrc

- name: Zip Folder
run: |
zip -r ${{ steps.set-file-base.outputs.FILE_BASE }}.zip ./hdfsrc
tar -zcvf ${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz ./hdfsrc
- name: List files in the repository
run: |
ls -l ${{ github.workspace }}
ls $GITHUB_WORKSPACE
# Save files created by release script
- name: Save tgz-tarball
uses: actions/upload-artifact@v4
with:
name: tgz-tarball
path: ${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`

- name: Save zip-tarball
uses: actions/upload-artifact@v4
with:
name: zip-tarball
path: ${{ steps.set-file-base.outputs.FILE_BASE }}.zip
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`

- name: Save NEWSLETTER
uses: actions/upload-artifact@v4
with:
name: NEWSLETTER
path: ./hdfsrc/release_docs/NEWSLETTER.txt
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
uses: ./.github/workflows/tarball.yml
with:
# use_tag: ${{ inputs.use_tag }}
use_environ: release

call-workflow-ctest:
needs: create-files-ctest
needs: call-workflow-tarball
uses: ./.github/workflows/cmake-ctest.yml
with:
file_base: ${{ needs.create-files-ctest.outputs.file_base }}
file_base: ${{ needs.call-workflow-tarball.outputs.file_base }}
preset_name: ci-StdShar
use_environ: release

call-workflow-abi:
needs: [log-the-inputs, create-files-ctest, call-workflow-ctest]
needs: [log-the-inputs, call-workflow-tarball, call-workflow-ctest]
uses: ./.github/workflows/abi-report.yml
with:
file_ref: '1_14_3'
file_base: ${{ needs.create-files-ctest.outputs.file_base }}
file_base: ${{ needs.call-workflow-tarball.outputs.file_base }}
use_tag: ${{ needs.log-the-inputs.outputs.rel_tag }}
use_environ: release

call-workflow-release:
needs: [log-the-inputs, create-files-ctest, call-workflow-ctest, call-workflow-abi]
needs: [log-the-inputs, call-workflow-tarball, call-workflow-ctest, call-workflow-abi]
permissions:
contents: write # In order to allow tag creation
uses: ./.github/workflows/release-files.yml
with:
file_base: ${{ needs.create-files-ctest.outputs.file_base }}
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 }}
use_tag: ${{ needs.log-the-inputs.outputs.rel_tag }}
Expand Down

0 comments on commit 4b596bc

Please sign in to comment.