Skip to content

Commit f3fda01

Browse files
authored
Merge pull request #471 from mattjala/no_comm_check
Remove recent commit check from release workflow
2 parents 0da76c3 + 40966c7 commit f3fda01

2 files changed

Lines changed: 23 additions & 40 deletions

File tree

.github/workflows/daily-build.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ name: hdfview daily build
33
# Triggers the workflow on a schedule or on demand
44
on:
55
workflow_dispatch:
6-
inputs:
7-
use_ignore:
8-
description: 'Ignore has_changes check'
9-
type: string
10-
required: false
11-
default: check
126
schedule:
137
- cron: "7 0 * * *"
148

@@ -17,14 +11,34 @@ permissions:
1711
packages: write
1812

1913
jobs:
14+
check-for-changes:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
has_changes: ${{ steps.check-new-commits.outputs.has-new-commits }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Check for changed source
22+
id: check-new-commits
23+
uses: adriangl/check-new-commits-action@v1
24+
with:
25+
seconds: 86400 # One day in seconds
26+
27+
- run: echo "You have ${{ steps.check-new-commits.outputs.new-commits-number }} new commit(s) ✅!"
28+
if: ${{ steps.check-new-commits.outputs.has-new-commits == 'true' }}
29+
30+
- run: echo "No new commits in the last 24 hours."
31+
if: ${{ steps.check-new-commits.outputs.has-new-commits != 'true' }}
32+
2033
get-base-names:
34+
needs: check-for-changes
35+
if: ${{ needs.check-for-changes.outputs.has_changes == 'true' }}
2136
runs-on: ubuntu-latest
2237
outputs:
2338
hdf4-name: ${{ steps.gethdf4base.outputs.HDF4_NAME_BASE }}
2439
hdf5-name: ${{ steps.gethdf5base.outputs.HDF5_NAME_BASE }}
2540
hdfview-name: ${{ steps.gethdfviewbase.outputs.HDFVIEW_NAME_BASE }}
2641
has-previous-build: ${{ steps.check-last-file.outputs.EXISTS }}
27-
run-ignore: ${{ steps.getinputs.outputs.INPUTS_IGNORE }}
2842

2943
steps:
3044
- uses: actions/checkout@v4.1.7
@@ -81,18 +95,10 @@ jobs:
8195
echo "hdf4 base name is ${{ steps.gethdf4base.outputs.HDF4_NAME_BASE }}."
8296
echo "hdf5 base name is ${{ steps.gethdf5base.outputs.HDF5_NAME_BASE }}."
8397
84-
- name: Read inputs
85-
id: getinputs
86-
run: |
87-
echo "INPUTS_IGNORE=${{ inputs.use_ignore }}" >> $GITHUB_OUTPUT
88-
89-
- run: echo "use_ignore is ${{ steps.getinputs.outputs.INPUTS_IGNORE }}."
90-
9198
call-workflow-tarball:
9299
needs: get-base-names
93100
uses: ./.github/workflows/tarball.yml
94101
with:
95-
use_ignore: ${{ needs.get-base-names.outputs.run-ignore }}
96102
build_environment: snapshot
97103

98104
call-workflow-maven-build:
@@ -106,7 +112,6 @@ jobs:
106112
hdf5_release_tag: snapshot
107113
hdf5_artifact_basename: ${{ needs.get-base-names.outputs.hdf5-name }}
108114
build_environment: snapshot
109-
if: ${{ ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-base-names.outputs.run-ignore == 'ignore')) }}
110115

111116
call-workflow-release:
112117
needs: [get-base-names, call-workflow-tarball, call-workflow-maven-build]
@@ -119,13 +124,11 @@ jobs:
119124
file_sha: ${{ needs.call-workflow-tarball.outputs.file_sha }}
120125
release_version_tag: v99.99.99
121126
build_environment: snapshot
122-
if: ${{ ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-base-names.outputs.run-ignore == 'ignore')) }}
123127

124128
# Remove old snapshot artifacts from the GitHub release to prevent accumulation
125129
# Only runs if:
126130
# 1. There was a previous build (last-file.txt exists)
127131
# 2. The new build has a different base name (commit SHA changed)
128-
# 3. The build succeeded or ignore flag is set
129132
call-workflow-remove:
130133
needs: [get-base-names, call-workflow-tarball, call-workflow-maven-build, call-workflow-release]
131134
permissions:
@@ -135,5 +138,5 @@ jobs:
135138
artifact_basename: ${{ needs.get-base-names.outputs.hdfview-name }}
136139
release_version_tag: v99.99.99
137140
build_environment: snapshot
138-
if: ${{ needs.get-base-names.outputs.has-previous-build == 'true' && ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-base-names.outputs.run-ignore == 'ignore')) && (needs.get-base-names.outputs.hdfview-name != needs.call-workflow-tarball.outputs.artifact_basename) }}
141+
if: ${{ needs.get-base-names.outputs.has-previous-build == 'true' && (needs.get-base-names.outputs.hdfview-name != needs.call-workflow-tarball.outputs.artifact_basename) }}
139142

.github/workflows/tarball.yml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,12 @@ name: hdfview tarball
44
on:
55
workflow_call:
66
inputs:
7-
use_ignore:
8-
description: 'Ignore has_changes check'
9-
type: string
10-
required: false
11-
default: check
127
build_environment:
138
description: 'Environment to locate files'
149
type: string
1510
required: true
1611
default: snapshot
1712
outputs:
18-
has_changes:
19-
description: "Whether there were changes the previous day"
20-
value: ${{ jobs.check_commits.outputs.has_changes }}
2113
source_base:
2214
description: "The common version name of the binaries"
2315
value: ${{ jobs.create_tarball.outputs.source_base }}
@@ -39,7 +31,6 @@ jobs:
3931
name: Check for recent commits
4032
runs-on: ubuntu-latest
4133
outputs:
42-
has_changes: ${{ steps.check-new-commits.outputs.has-new-commits }}
4334
branch_ref: ${{ steps.get-branch-name.outputs.BRANCH_REF }}
4435
branch_sha: ${{ steps.get-branch-sha.outputs.BRANCH_SHA }}
4536
steps:
@@ -63,24 +54,13 @@ jobs:
6354
SHORT_SHA=$(echo "${{ env.GITHUB_WF_SHA }}" | cut -c1-7)
6455
echo "BRANCH_SHA=$SHORT_SHA" >> $GITHUB_OUTPUT
6556
66-
- name: Check for changed source
67-
id: check-new-commits
68-
uses: adriangl/check-new-commits-action@v1
69-
with:
70-
seconds: 86400 # One day in seconds
71-
branch: '${{ steps.get-branch-name.outputs.branch_ref }}'
72-
if: ${{ (inputs.build_environment == 'snapshot' && inputs.use_ignore == 'check') }}
73-
74-
- run: echo "You have ${{ steps.check-new-commits.outputs.new-commits-number }} new commit(s) in ${{ steps.get-branch-name.outputs.BRANCH_REF }} ✅!"
75-
if: ${{ steps.check-new-commits.outputs.has-new-commits == 'true' }}
76-
7757
- run: echo "Short commit sha is ${{ steps.get-branch-sha.outputs.BRANCH_SHA }}!"
7858

7959
create_tarball:
8060
name: Create a source tarball
8161
runs-on: ubuntu-latest
8262
needs: check_commits
83-
if: ${{ ((inputs.build_environment == 'snapshot') && ((needs.check_commits.outputs.has_changes == 'true') || (inputs.use_ignore == 'ignore'))) || (inputs.build_environment == 'release') || (inputs.build_environment == 'pre-release') }}
63+
if: ${{ (inputs.build_environment == 'snapshot') || (inputs.build_environment == 'release') || (inputs.build_environment == 'pre-release') }}
8464
outputs:
8565
artifact_basename: ${{ steps.set-artifact-basename.outputs.ARTIFACT_BASENAME }}
8666
source_base: ${{ steps.version.outputs.TAG_VERSION }}

0 commit comments

Comments
 (0)