Skip to content

Commit

Permalink
Merge changes from develop (#3239)
Browse files Browse the repository at this point in the history
* Merge changes from develop

* Store name for last snapshot

* Merge bbrelease into release
  • Loading branch information
byrnHDF authored Jul 18, 2023
1 parent 779db12 commit c736d0f
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 399 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/genparser -text
bin/switch_maint_mode -text
c++/src/H5OcreatProp.cpp -text
Expand Down
34 changes: 24 additions & 10 deletions .github/workflows/release-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
commit_sha: ${{ inputs.file_sha }}
tag: "${{ inputs.use_tag }}"
force_push_tag: true
message: "Latest snapshot"
message: "Latest snapshot-1.10"
if: ${{ inputs.use_environ == 'snapshots' }}

# Print result using the action output.
Expand Down Expand Up @@ -114,13 +114,19 @@ jobs:
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_release
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 }}.doxygen.zip
${{ steps.get-file-base.outputs.FILE_BASE }}.tar.gz
${{ steps.get-file-base.outputs.FILE_BASE }}.zip
Expand All @@ -129,14 +135,22 @@ jobs:
${{ 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: Store Release url
run: |
echo "${{ steps.create_release.outputs.upload_url }}" > ./upload_url

# - uses: actions/upload-artifact@v3
# with:
# path: ./upload_url
# name: upload_url
- 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 }}.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.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: |
Expand Down
97 changes: 67 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ on:
type: string
required: false
default: snapshot-1.10
use_environ:
description: 'Environment to locate files'
type: choice
required: true
default: snapshots
options:
- snapshots
- release

permissions:
contents: read
Expand All @@ -26,38 +18,83 @@ permissions:
jobs:
log-the-inputs:
runs-on: ubuntu-latest
outputs:
rel_tag: ${{ steps.get-tag-name.outputs.RELEASE_TAG }}
steps:
- run: |
echo "Tag: $TAG"
echo "Environment: $ENVIRONMENT"
env:
TAG: ${{ inputs.tag }}
ENVIRONMENT: ${{ inputs.environment }}

call-workflow-tarball:
- 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
uses: ./.github/workflows/tarball.yml
with:
use_tag: ${{ inputs.use_tag }}
use_environ: ${{ inputs.use_environ }}
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:
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@v3
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@v3
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`

call-workflow-ctest:
needs: call-workflow-tarball
needs: create-files-ctest
uses: ./.github/workflows/cmake-ctest.yml
with:
file_base: ${{ needs.call-workflow-tarball.outputs.file_base }}
use_tag: ${{ inputs.use_tag }}
use_environ: ${{ inputs.use_environ }}
file_base: ${{ needs.create-files-ctest.outputs.file_base }}

call-workflow-release:
needs: [call-workflow-tarball, call-workflow-ctest]
#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.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: ${{ inputs.use_tag }}
use_environ: ${{ inputs.use_environ }}
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

2 changes: 1 addition & 1 deletion .github/workflows/tarball.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
if: ${{ (inputs.use_environ == 'snapshots') && (needs.check_commits.outputs.has_changes == 'true') }}
run: |
cd "$GITHUB_WORKSPACE/hdfsrc"
bin/bbrelease -d $GITHUB_WORKSPACE --branch ${{ needs.check_commits.outputs.branch_ref }} --revision gzip zip
bin/release -d $GITHUB_WORKSPACE --branch ${{ needs.check_commits.outputs.branch_ref }} --revision gzip zip
shell: bash

- name: Create release file base name
Expand Down
Loading

0 comments on commit c736d0f

Please sign in to comment.