Skip to content

Commit

Permalink
Merge branch 'HDFGroup:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoklee authored Aug 20, 2023
2 parents 1d5042e + 96e44f7 commit b5ccb85
Show file tree
Hide file tree
Showing 21 changed files with 524 additions and 561 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
* text=auto !eol
bin/bbrelease -text
bin/h4_release_check.sh -text
config/cmake/CPack.Info.plist.in -text svneol=unset#application/xml
config/cmake/FindJNI.cmake -text
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,29 @@ permissions:
jobs:
call-workflow-tarball:
uses: ./.github/workflows/tarball.yml
with:
#use_tag: snapshot
use_environ: snapshots

call-workflow-ctest:
needs: call-workflow-tarball
uses: ./.github/workflows/cmake-ctest.yml
with:
file_base: ${{ needs.call-workflow-tarball.outputs.file_base }}
#use_tag: snapshot
#use_environ: snapshots
if: ${{ needs.call-workflow-tarball.outputs.has_changes == 'true' }}

call-workflow-release:
needs: [call-workflow-tarball, call-workflow-ctest]
permissions:
contents: write # In order to allow tag creation
uses: ./.github/workflows/release.yml
uses: ./.github/workflows/release-files.yml
with:
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 }}
use_tag: snapshot
use_environ: snapshots
if: ${{ needs.call-workflow-tarball.outputs.has_changes == 'true' }}

147 changes: 147 additions & 0 deletions .github/workflows/release-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: hdf4 dev release-files

# Controls when the action will run. Triggers the workflow on a schedule
on:
workflow_call:
inputs:
use_tag:
description: 'Release version tag'
type: string
required: false
default: snapshot
use_environ:
description: 'Environment to locate files'
type: string
required: true
default: snapshots
file_base:
description: "The common base name of the source tarballs"
required: true
type: string
file_branch:
description: "The branch name for the source tarballs"
required: true
type: string
file_sha:
description: "The sha for the source tarballs"
required: true
type: string

# Minimal permissions to be inherited by any job that doesn't declare its own permissions
permissions:
contents: read

# Previous workflows must pass to get here so tag the commit that created the files
jobs:
create-tag:
runs-on: ubuntu-latest
permissions:
contents: write # In order to allow tag creation
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Get Sources
uses: actions/checkout@v3
with:
fetch-depth: 0

- run: |
git checkout ${{ inputs.file_sha }}
- uses: rickstaa/action-create-tag@v1
id: "tag_create"
with:
commit_sha: ${{ inputs.file_sha }}
tag: "${{ inputs.use_tag }}"
force_push_tag: true
message: "Latest snapshot"
if: ${{ inputs.use_environ == 'snapshots' }}

# Print result using the action output.
- run: |
echo "Tag already present: ${{ steps.tag_create.outputs.tag_exists }}"
PreRelease-getfiles:
runs-on: ubuntu-latest
needs: create-tag
environment: ${{ inputs.use_environ }}
permissions:
contents: write
steps:
- name: Get file base name
id: get-file-base
run: |
FILE_NAME_BASE=$(echo "${{ inputs.file_base }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
# Get files created by tarball script
- name: Get tgz-tarball (Linux)
uses: actions/download-artifact@v3
with:
name: tgz-tarball
path: ${{ github.workspace }}

- name: Get zip-tarball (Windows)
uses: actions/download-artifact@v3
with:
name: zip-tarball
path: ${{ github.workspace }}

# Get files created by cmake-ctest script
- name: Get published binary (Windows)
uses: actions/download-artifact@v3
with:
name: zip-vs2022-binary
path: ${{ github.workspace }}

- name: Get published binary (MacOS)
uses: actions/download-artifact@v3
with:
name: tgz-osx12-binary
path: ${{ github.workspace }}

- name: Get published binary (Linux)
uses: actions/download-artifact@v3
with:
name: tgz-ubuntu-2204-binary
path: ${{ github.workspace }}

- name: Store snapshot name
run: |
echo "${{ steps.get-file-base.outputs.FILE_BASE }}" > ./last-file.txt
- name: PreRelease tag
id: create_prerelease
if: ${{ (inputs.use_environ == 'snapshots') }}
uses: softprops/action-gh-release@v1
with:
tag_name: "${{ inputs.use_tag }}"
prerelease: true
files: |
last-file.txt
${{ 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.tar.gz
${{ steps.get-file-base.outputs.FILE_BASE }}-win_vs2022.zip
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@v1
with:
tag_name: "${{ inputs.use_tag }}"
prerelease: false
#body_path: ${{ github.workspace }}-CHANGELOG.txt
files: |
${{ 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.tar.gz
${{ steps.get-file-base.outputs.FILE_BASE }}-win_vs2022.zip
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 }}
ls ${{ runner.workspace }}
167 changes: 72 additions & 95 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,123 +1,100 @@
name: hdf4 dev release
name: hdf4 release build

# Controls when the action will run. Triggers the workflow on a schedule
# Controls when the action will run. Triggers the workflow on a manual run
on:
workflow_call:
workflow_dispatch:
inputs:
file_base:
description: "The common base name of the source tarballs"
required: true
type: string
file_branch:
description: "The branch name for the source tarballs"
required: true
type: string
file_sha:
description: "The sha for the source tarballs"
required: true
use_tag:
description: 'Release version tag'
type: string
required: false
default: snapshot

# Minimal permissions to be inherited by any job that doesn't declare its own permissions
permissions:
contents: read

# Previous workflows must pass to get here so tag the commit that created the files
# A workflow run is made up of one or more jobs that can run sequentially or
# in parallel.
jobs:
create-tag:
log-the-inputs:
runs-on: ubuntu-latest
permissions:
contents: write # In order to allow tag creation
outputs:
rel_tag: ${{ steps.get-tag-name.outputs.RELEASE_TAG }}
steps:
- name: Get tag name
id: get-tag-name
env:
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:
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/checkout@v3
with:
fetch-depth: 0
path: hdfsrc

- run: |
git checkout ${{ inputs.file_sha }}
- uses: rickstaa/action-create-tag@v1
id: "tag_create"
with:
commit_sha: ${{ inputs.file_sha }}
tag: "snapshot"
force_push_tag: true
message: "Latest snapshot"

# Print result using the action output.
- run: |
echo "Tag already present: ${{ steps.tag_create.outputs.tag_exists }}"
- 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
PreRelease-getfiles:
runs-on: ubuntu-latest
needs: create-tag
environment: snapshots
permissions:
contents: write
steps:
- name: Get file base name
id: get-file-base
- name: List files in the repository
run: |
FILE_NAME_BASE=$(echo "${{ inputs.file_base }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
ls -l ${{ github.workspace }}
ls $GITHUB_WORKSPACE
# Get files created by tarball script
- name: Get tgz-tarball (Linux)
uses: actions/download-artifact@v3
# Save files created by release script
- name: Save tgz-tarball
uses: actions/upload-artifact@v3
with:
name: tgz-tarball
path: ${{ github.workspace }}
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: Get zip-tarball (Windows)
uses: actions/download-artifact@v3
- name: Save zip-tarball
uses: actions/upload-artifact@v3
with:
name: zip-tarball
path: ${{ github.workspace }}

# Get files created by cmake-ctest script
- name: Get published binary (Windows)
uses: actions/download-artifact@v3
with:
name: zip-vs2022-binary
path: ${{ github.workspace }}

- name: Get published binary (MacOS)
uses: actions/download-artifact@v3
with:
name: tgz-osx12-binary
path: ${{ github.workspace }}

- name: Get published binary (Linux)
uses: actions/download-artifact@v3
with:
name: tgz-ubuntu-2204-binary
path: ${{ github.workspace }}

- name: PreRelease tag
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: "snapshot"
prerelease: true
files: |
${{ 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.tar.gz
${{ steps.get-file-base.outputs.FILE_BASE }}-win_vs2022.zip
path: ${{ steps.set-file-base.outputs.FILE_BASE }}.zip
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`

- name: Store Release url
run: |
echo "${{ steps.create_release.outputs.upload_url }}" > ./upload_url
call-workflow-ctest:
needs: create-files-ctest
uses: ./.github/workflows/cmake-ctest.yml
with:
file_base: ${{ needs.create-files-ctest.outputs.file_base }}

# - uses: actions/upload-artifact@v3
# with:
# path: ./upload_url
# name: upload_url
call-workflow-release:
#needs: [call-workflow-tarball, call-workflow-ctest]
needs: [log-the-inputs, create-files-ctest, call-workflow-ctest]
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_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 }}
use_environ: release

- name: List files for the space (Linux)
run: |
ls -l ${{ github.workspace }}
ls ${{ runner.workspace }}
Loading

0 comments on commit b5ccb85

Please sign in to comment.