Skip to content

Commit

Permalink
Merge pull request #37 from byrnHDF/master-ci-environs
Browse files Browse the repository at this point in the history
Master ci environs
  • Loading branch information
lrknox authored Oct 18, 2023
2 parents 32cf539 + 0acfb05 commit 98a047b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
use_environ:
description: 'Environment to locate files'
type: string
required: true
required: false
default: snapshots
# push:
# branches: [ "master" ]
Expand Down Expand Up @@ -75,15 +75,15 @@ jobs:
if: ${{ ((needs.get-base-names.outputs.run-environ == 'snapshots') && ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-base-names.outputs.run-ignore == 'ignore'))) || (needs.get-base-names.outputs.run-environ == 'release') }}

call-workflow-release:
needs: [call-workflow-tarball, call-workflow-ctest]
needs: [get-base-names, call-workflow-tarball, 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: ${{ needs.get-base-names.outputs.run-environ }}
use_tag: snapshot
use_environ: ${{ needs.get-base-names.outputs.run-environ }}
if: ${{ ((needs.get-base-names.outputs.run-environ == 'snapshots') && ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-base-names.outputs.run-ignore == 'ignore'))) || (needs.get-base-names.outputs.run-environ == 'release') }}

7 changes: 5 additions & 2 deletions .github/workflows/release-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Get Sources
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- run: |
- name: Get Commit
if: ${{ (inputs.use_environ == 'snapshots') }}
run: |
git checkout ${{ inputs.file_sha }}
- uses: rickstaa/action-create-tag@v1
Expand Down Expand Up @@ -87,6 +89,7 @@ jobs:
path: ${{ github.workspace }}

- name: Store snapshot name
if: ${{ (inputs.use_environ == 'snapshots') }}
run: |
echo "${{ steps.get-file-base.outputs.FILE_BASE }}" > ./last-file.txt
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
type: string
required: false
default: snapshot
use_name:
description: 'Examples Release Name'
type: string
required: false
default: hdf5-examples-snapshot

permissions:
contents: read
Expand All @@ -20,20 +25,16 @@ jobs:
runs-on: ubuntu-latest
outputs:
rel_tag: ${{ steps.get-tag-name.outputs.RELEASE_TAG }}
rel_name: ${{ steps.get-tag-name.outputs.RELEASE_NAME }}
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
TAG_NAME: ${{ inputs.use_name }}
run: |
echo "RELEASE_TAG=$TAG" >> $GITHUB_OUTPUT
echo "RELEASE_NAME=$TAG_NAME" >> $GITHUB_OUTPUT
create-files-ctest:
needs: log-the-inputs
Expand All @@ -44,7 +45,7 @@ jobs:
- name: Set file base name
id: set-file-base
run: |
FILE_NAME_BASE=$(echo "${{ needs.log-the-inputs.outputs.rel_tag }}")
FILE_NAME_BASE=$(echo "${{ needs.log-the-inputs.outputs.rel_name }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
shell: bash

Expand Down Expand Up @@ -88,14 +89,13 @@ jobs:
use_environ: release

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_branch: ${{ needs.log-the-inputs.outputs.rel_name }}
file_sha: ${{ needs.log-the-inputs.outputs.rel_tag }}
use_tag: ${{ needs.log-the-inputs.outputs.rel_tag }}
use_environ: release
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tarball.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ jobs:
run: |
if [[ '${{ inputs.use_environ }}' == 'snapshots' && '${{ needs.check_commits.outputs.has_changes }}' == 'true' ]]
then
FILE_NAME_BASE=$(echo "hdf5-${{ needs.check_commits.outputs.branch_ref }}-${{ needs.check_commits.outputs.branch_sha }}")
FILE_NAME_BASE=$(echo "hdf5-examples-${{ needs.check_commits.outputs.branch_ref }}-${{ needs.check_commits.outputs.branch_sha }}")
else
FILE_NAME_BASE=$(echo "hdf5-${{ steps.version.outputs.TAG_VERSION }}")
FILE_NAME_BASE=$(echo "hdf5-examples-${{ steps.version.outputs.TAG_VERSION }}")
fi
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
shell: bash
Expand Down

0 comments on commit 98a047b

Please sign in to comment.