Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add publish files from branch workflow #732

Merged
merged 12 commits into from
Jul 23, 2024
36 changes: 32 additions & 4 deletions .github/workflows/cmake-ctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,32 @@ jobs:
cmake --workflow --preset=${{ inputs.preset_name }}-MSVC --fresh
shell: bash

- name: Publish binary (Windows)
id: publish-ctest-binary
- name: Create build folders (Windows)
run: |
mkdir "${{ runner.workspace }}/build"
mkdir "${{ runner.workspace }}/build/hdf4"
shell: bash

- name: Publish binary (Windows)
id: publish-ctest-binary
run: |
Copy-Item -Path ${{ runner.workspace }}/hdf4/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING -Destination ${{ runner.workspace }}/build/hdf4/
Copy-Item -Path ${{ runner.workspace }}/hdf4/build/${{ inputs.preset_name }}-MSVC/README.txt -Destination ${{ runner.workspace }}/build/hdf4/
Copy-Item -Path ${{ runner.workspace }}/hdf4/build/${{ inputs.preset_name }}-MSVC/* -Destination ${{ runner.workspace }}/build/hdf4/ -Include *.zip
cd "${{ runner.workspace }}/build"
7z a -tzip ${{ steps.set-file-base.outputs.FILE_BASE }}-win-vs2022_cl.zip hdf4
shell: pwsh

- name: Publish binary (Windows)
id: publish-ctest-binary
run: |
Copy-Item -Path ${{ runner.workspace }}/hdf4/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING -Destination ${{ runner.workspace }}/build/hdf4/
Copy-Item -Path ${{ runner.workspace }}/hdf4/build/${{ inputs.preset_name }}-MSVC/README.txt -Destination ${{ runner.workspace }}/build/hdf4/
Copy-Item -Path ${{ runner.workspace }}/hdf4/build/${{ inputs.preset_name }}-MSVC/* -Destination ${{ runner.workspace }}/build/hdf4/ -Include *.msi
cd "${{ runner.workspace }}/build"
7z a -tzip ${{ steps.set-file-base.outputs.FILE_BASE }}-win-vs2022_msi.zip hdf4
shell: pwsh

- name: List files in the space (Windows)
run: |
Get-ChildItem -Path ${{ github.workspace }}
Expand Down Expand Up @@ -380,18 +394,32 @@ jobs:
cmake --workflow --preset=${{ inputs.preset_name }}-win-Intel --fresh
shell: pwsh

- name: Publish binary (Windows_intel)
id: publish-ctest-binary
- name: Create build folders (Windows_intel)
run: |
mkdir "${{ runner.workspace }}/build"
mkdir "${{ runner.workspace }}/build/hdf4"
shell: bash

- name: Publish binary (Windows_intel)
id: publish-ctest-binary
run: |
Copy-Item -Path ${{ runner.workspace }}/hdf4/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING -Destination ${{ runner.workspace }}/build/hdf4/
Copy-Item -Path ${{ runner.workspace }}/hdf4/build/${{ inputs.preset_name }}-Intel/README.txt -Destination ${{ runner.workspace }}/build/hdf4/
Copy-Item -Path ${{ runner.workspace }}/hdf4/build/${{ inputs.preset_name }}-Intel/* -Destination ${{ runner.workspace }}/build/hdf4/ -Include *.zip
cd "${{ runner.workspace }}/build"
7z a -tzip ${{ steps.set-file-base.outputs.FILE_BASE }}-win-vs2022_intel.zip hdf4
shell: pwsh

- name: Publish binary (Windows_intel)
id: publish-ctest-binary
run: |
Copy-Item -Path ${{ runner.workspace }}/hdf4/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING -Destination ${{ runner.workspace }}/build/hdf4/
Copy-Item -Path ${{ runner.workspace }}/hdf4/build/${{ inputs.preset_name }}-Intel/README.txt -Destination ${{ runner.workspace }}/build/hdf4/
Copy-Item -Path ${{ runner.workspace }}/hdf4/build/${{ inputs.preset_name }}-Intel/* -Destination ${{ runner.workspace }}/build/hdf4/ -Include *.msi
cd "${{ runner.workspace }}/build"
7z a -tzip ${{ steps.set-file-base.outputs.FILE_BASE }}-win-vs2022_intel_msi.zip hdf4
shell: pwsh

- name: List files in the space (Windows_intel)
run: |
Get-ChildItem -Path ${{ github.workspace }}
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/publish-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: hdf4 publish files in HDF4 folder from branch to S3

# Triggers the workflow on demand
on:
workflow_dispatch:
inputs:
local_dir:
description: 'HDF4 local directory'
type: string
required: true
target_dir:
description: 'hdf4 target bucket directory'
type: string
required: true
permissions:
contents: read

jobs:
publish-tag:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Get Sources
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
ref: '${{ github.head_ref || github.ref_name }}'

- name: List files for the space
run: |
ls -l ${{ github.workspace }}
ls ${{ github.workspace }}/HDF4

- name: Setup AWS CLI
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Sync dir to S3 bucket
run: |
aws s3 sync ./HDF4/${{ inputs.local_dir }} s3://${{ secrets.AWS_S3_BUCKET }}/${{ vars.TARGET_PATH }}/${{ inputs.target_dir }}

4 changes: 2 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ jobs:
aws s3 sync ./HDF4 s3://${{ secrets.AWS_S3_BUCKET }}/${{ vars.TARGET_PATH }}/${{ inputs.target_dir }}/downloads --delete

- name: Uncompress source (Linux)
run: tar -zxvf ${{ github.workspace }}/${{ inputs.use_hdf }}.doxygen.tar.gz
run: tar -zxvf ${{ github.workspace }}/HDF4/${{ inputs.use_hdf }}.doxygen.tar.gz

- name: Sync userguide to S3 bucket
run: |
aws s3 sync ./doxygen s3://${{ secrets.AWS_S3_BUCKET }}/${{ vars.TARGET_PATH }}/${{ inputs.target_dir }}/documentation --delete
aws s3 sync ./HDF4/doxygen s3://${{ secrets.AWS_S3_BUCKET }}/${{ vars.TARGET_PATH }}/${{ inputs.target_dir }}/documentation/doxygen --delete

4 changes: 0 additions & 4 deletions HDF4Examples/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"inherits": [
"ci-x64-Release-MSVC",
"ci-StdJava",
"ci-StdFortran",
"ci-StdShar"
]
},
Expand All @@ -53,7 +52,6 @@
"inherits": [
"ci-x64-Release-Clang",
"ci-StdJava",
"ci-StdFortran",
"ci-StdShar"
]
},
Expand All @@ -63,7 +61,6 @@
"inherits": [
"ci-x64-Release-GNUC",
"ci-StdJava",
"ci-StdFortran",
"ci-StdShar"
]
},
Expand All @@ -73,7 +70,6 @@
"inherits": [
"ci-x64-Release-Intel",
"ci-StdJava",
"ci-StdFortran",
"ci-StdShar"
]
}
Expand Down
22 changes: 11 additions & 11 deletions HDF4Examples/config/cmake/HDFExampleMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ macro (BASIC_SETTINGS varname)
#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common")
endif ()
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
Expand Down Expand Up @@ -150,9 +150,17 @@ macro (HDF4_SUPPORT)
endif ()
set (H4EX_HDF4_DUMP_EXECUTABLE $<TARGET_FILE:${HDF4_NAMESPACE}hdp>)
else ()
if (HDF4_BUILD_MODE)
string (TOUPPER "_${HDF4_BUILD_MODE}" UPPER_BUILD_TYPE)
elseif (HDF_CFG_NAME)
string (TOUPPER "_${HDF_CFG_NAME}" UPPER_BUILD_TYPE)
else ()
set (UPPER_BUILD_TYPE "")
endif ()
get_filename_component (_LIBRARY_PATH ${HDF4_INCLUDE_DIR} DIRECTORY)
set (HDF4_LIBRARY_PATH "${_LIBRARY_PATH}/lib")
if (USE_SHARED_LIBS AND HDF4_shared_C_FOUND)
set (H4EX_HDF4_LINK_LIBS ${H4EX_HDF4_LINK_LIBS} ${HDF4_C_SHARED_LIBRARY})
set (HDF4_LIBRARY_PATH ${PACKAGE_PREFIX_DIR}/lib)
else ()
set (H4EX_HDF4_LINK_LIBS ${H4EX_HDF4_LINK_LIBS} ${HDF4_C_STATIC_LIBRARY})
endif ()
Expand Down Expand Up @@ -185,15 +193,7 @@ macro (HDF4_SUPPORT)
if (HDF_BUILD_JAVA AND HDF4_Java_FOUND)
if (${HDF4_BUILD_JAVA})
set (CMAKE_JAVA_INCLUDE_PATH "${CMAKE_JAVA_INCLUDE_PATH};${HDF4_JAVA_INCLUDE_DIRS}")
if (HDF4_BUILD_MODE)
string(TOUPPER "${HDF4_BUILD_MODE}" UPPER_BUILD_TYPE)
get_target_property(libsoname ${HDF4_JAVA_LIBRARY} IMPORTED_SONAME_${UPPER_BUILD_TYPE})
elseif (HDF_CFG_NAME)
string(TOUPPER "${HDF_CFG_NAME}" UPPER_BUILD_TYPE)
get_target_property(libsoname ${HDF4_JAVA_LIBRARY} IMPORTED_SONAME_${UPPER_BUILD_TYPE})
else ()
get_target_property(libsoname ${HDF4_JAVA_LIBRARY} IMPORTED_SONAME)
endif ()
get_target_property (libsoname ${HDF4_JAVA_LIBRARY} IMPORTED_SONAME${UPPER_BUILD_TYPE})
get_filename_component (libname ${libsoname} NAME_WE)
string (REGEX REPLACE "^lib" "" libname ${libname})
message (STATUS "HDF4 lib:${HDF4_JAVA_LIBRARY} OR ${libsoname} OR ${libname}")
Expand Down
Loading