Skip to content

Commit

Permalink
Fix relative files and update CI (#323)
Browse files Browse the repository at this point in the history
* Fix relative file path and update CI
* Update CI for inputs handling
* remove PR trigger
  • Loading branch information
byrnHDF authored Sep 23, 2024
1 parent 683e02d commit 1b378f8
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 75 deletions.
53 changes: 24 additions & 29 deletions .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: hdfview daily build

# Triggered on pull request or schedule or on demand
# Triggers the workflow on a schedule or on demand
on:
workflow_dispatch:
inputs:
Expand All @@ -9,8 +9,6 @@ on:
type: string
required: false
default: check
pull_request:
branches: [ "master" ]
schedule:
- cron: "5 0 * * *"

Expand All @@ -27,7 +25,7 @@ jobs:
run-ignore: ${{ steps.getinputs.outputs.INPUTS_IGNORE }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.7

- name: Get hdfview release base name
uses: dsaltares/fetch-gh-release-asset@master
Expand Down Expand Up @@ -71,13 +69,10 @@ jobs:
- name: Read inputs
id: getinputs
run: |
echo "INPUTS_IGNORE=${{ ((github.event.inputs.use_ignore == '' && github.event.inputs.use_ignore) || 'ignore') }}" >> $GITHUB_OUTPUT
echo "INPUTS_ENVIRON=${{ ((github.event.inputs.use_environ == '' && github.event.inputs.use_environ) || 'snapshots') }}" >> $GITHUB_OUTPUT
echo "INPUTS_IGNORE=${{ github.event.inputs.use_ignore }}" >> $GITHUB_OUTPUT
- run: echo "use_ignore is ${{ steps.getinputs.outputs.INPUTS_IGNORE }}."

- run: echo "use_environ is ${{ steps.getinputs.outputs.INPUTS_ENVIRON }}."

call-workflow-tarball:
needs: get-base-names
uses: ./.github/workflows/tarball.yml
Expand All @@ -95,16 +90,16 @@ jobs:
use_hdf5: ${{ needs.get-base-names.outputs.hdf5-name }}
name_hdf5: ${{ needs.get-base-names.outputs.hdf5-name }}
use_environ: snapshots
secrets:
APPLE_CERTS_BASE64: ${{ secrets.APPLE_CERTS_BASE64 }}
APPLE_CERTS_BASE64_PASSWD: ${{ secrets.APPLE_CERTS_BASE64_PASSWD }}
KEYCHAIN_PASSWD: ${{ secrets.KEYCHAIN_PASSWD }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_ENDPOINT: ${{ secrets.AZURE_ENDPOINT }}
AZURE_CODE_SIGNING_NAME: ${{ secrets.AZURE_CODE_SIGNING_NAME }}
AZURE_CERT_PROFILE_NAME: ${{ secrets.AZURE_CERT_PROFILE_NAME }}
secrets:
APPLE_CERTS_BASE64: ${{ secrets.APPLE_CERTS_BASE64 }}
APPLE_CERTS_BASE64_PASSWD: ${{ secrets.APPLE_CERTS_BASE64_PASSWD }}
KEYCHAIN_PASSWD: ${{ secrets.KEYCHAIN_PASSWD }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_ENDPOINT: ${{ secrets.AZURE_ENDPOINT }}
AZURE_CODE_SIGNING_NAME: ${{ secrets.AZURE_CODE_SIGNING_NAME }}
AZURE_CERT_PROFILE_NAME: ${{ secrets.AZURE_CERT_PROFILE_NAME }}

call-workflow-ant-app:
needs: [get-base-names, call-workflow-tarball]
Expand All @@ -115,16 +110,16 @@ jobs:
use_hdf5: ${{ needs.get-base-names.outputs.hdf5-name }}
name_hdf5: ${{ needs.get-base-names.outputs.hdf5-name }}
use_environ: snapshots
secrets:
APPLE_CERTS_BASE64: ${{ secrets.APPLE_CERTS_BASE64 }}
APPLE_CERTS_BASE64_PASSWD: ${{ secrets.APPLE_CERTS_BASE64_PASSWD }}
KEYCHAIN_PASSWD: ${{ secrets.KEYCHAIN_PASSWD }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_ENDPOINT: ${{ secrets.AZURE_ENDPOINT }}
AZURE_CODE_SIGNING_NAME: ${{ secrets.AZURE_CODE_SIGNING_NAME }}
AZURE_CERT_PROFILE_NAME: ${{ secrets.AZURE_CERT_PROFILE_NAME }}
secrets:
APPLE_CERTS_BASE64: ${{ secrets.APPLE_CERTS_BASE64 }}
APPLE_CERTS_BASE64_PASSWD: ${{ secrets.APPLE_CERTS_BASE64_PASSWD }}
KEYCHAIN_PASSWD: ${{ secrets.KEYCHAIN_PASSWD }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_ENDPOINT: ${{ secrets.AZURE_ENDPOINT }}
AZURE_CODE_SIGNING_NAME: ${{ secrets.AZURE_CODE_SIGNING_NAME }}
AZURE_CERT_PROFILE_NAME: ${{ secrets.AZURE_CERT_PROFILE_NAME }}

call-workflow-release:
needs: [get-base-names, call-workflow-tarball, call-workflow-ant, call-workflow-ant-app]
Expand All @@ -147,5 +142,5 @@ jobs:
file_base: ${{ needs.get-base-names.outputs.hdfview-name }}
use_tag: HDFView-99.99.99
use_environ: snapshots
if: ${{ ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-base-names.outputs.run-ignore == 'ignore')) }}
if: ${{ ((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.file_base) }}

7 changes: 4 additions & 3 deletions .github/workflows/publish-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ on:
description: 'HDFView target bucket directory'
type: string
required: true
permissions:
contents: read

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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@9a9194f87191a7e9055e3e9b95b8cfb13023bb08 # v4.1.7
with:
fetch-depth: 0
ref: '${{ github.head_ref || github.ref_name }}'
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ on:
description: 'HDFView target bucket directory'
type: string
required: true
permissions:
contents: read

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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@9a9194f87191a7e9055e3e9b95b8cfb13023bb08 # v4.1.7
with:
fetch-depth: 0
ref: '${{ github.head_ref || github.ref_name }}'
Expand Down Expand Up @@ -50,7 +51,7 @@ jobs:
ls ${{ github.workspace }}/HDFVIEW
- name: Setup AWS CLI
uses: aws-actions/configure-aws-credentials@v1
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 }}
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/release-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Get Sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@9a9194f87191a7e9055e3e9b95b8cfb13023bb08 # v4.1.7
with:
fetch-depth: 0
ref: '${{ github.head_ref || github.ref_name }}'
Expand Down Expand Up @@ -73,58 +73,58 @@ jobs:
# Get files created by tarball script
- name: Get tgz-tarball (Linux)
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: tgz-tarball
path: ${{ github.workspace }}

- name: Get zip-tarball (Windows)
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: zip-tarball
path: ${{ github.workspace }}

# Get files created by ant script
- name: Get published binary (Windows)
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: zip-win-vs2022-binary
path: ${{ github.workspace }}

- name: Get published binary (MacOS)
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: tgz-macos14_clang-binary
path: ${{ github.workspace }}

- name: Get published binary (Linux)
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: tgz-ubuntu-2204-binary
path: ${{ github.workspace }}

# Get files created by ant-app script
- name: Get published app binary (Windows)
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: zip-win-vs2022-app-binary
path: ${{ github.workspace }}

- name: Get published app binary (MacOS)
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: tgz-macos14_clang-app-binary
path: ${{ github.workspace }}

- name: Get published app binary (Linux)
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: tgz-ubuntu-2204-app-binary
path: ${{ github.workspace }}

# Get files created by tarball script
- name: Get UsersGuide (Linux)
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: docs-usersguide
path: ${{ github.workspace }}/UsersGuide
Expand Down Expand Up @@ -160,7 +160,7 @@ jobs:
echo "${{ steps.get-file-base.outputs.FILE_BASE }}" > ./last-file.txt
- name: Get NEWSLETTER
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: NEWSLETTER
path: ${{ github.workspace }}
Expand All @@ -172,7 +172,7 @@ jobs:
- name: PreRelease tag
id: create_prerelease
if: ${{ (inputs.use_environ == 'snapshots') }}
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # v2.0.5
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
with:
tag_name: "${{ inputs.use_tag }}"
prerelease: true
Expand All @@ -195,7 +195,7 @@ jobs:
- name: Release tag
id: create_release
if: ${{ (inputs.use_environ == 'release') }}
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # v2.0.5
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
with:
tag_name: "${{ inputs.use_tag }}"
prerelease: false
Expand Down
42 changes: 20 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ on:
permissions:
contents: read

# A workflow run is made up of one or more jobs that can run sequentially or
# in parallel.
jobs:
log-the-inputs:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -66,16 +64,16 @@ jobs:
name_hdf5: ${{ inputs.name_tag5 }}
snap_name: HDFView-${{ needs.call-workflow-tarball.outputs.source_base }}
use_environ: release
secrets:
APPLE_CERTS_BASE64: ${{ secrets.APPLE_CERTS_BASE64 }}
APPLE_CERTS_BASE64_PASSWD: ${{ secrets.APPLE_CERTS_BASE64_PASSWD }}
KEYCHAIN_PASSWD: ${{ secrets.KEYCHAIN_PASSWD }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_ENDPOINT: ${{ secrets.AZURE_ENDPOINT }}
AZURE_CODE_SIGNING_NAME: ${{ secrets.AZURE_CODE_SIGNING_NAME }}
AZURE_CERT_PROFILE_NAME: ${{ secrets.AZURE_CERT_PROFILE_NAME }}
secrets:
APPLE_CERTS_BASE64: ${{ secrets.APPLE_CERTS_BASE64 }}
APPLE_CERTS_BASE64_PASSWD: ${{ secrets.APPLE_CERTS_BASE64_PASSWD }}
KEYCHAIN_PASSWD: ${{ secrets.KEYCHAIN_PASSWD }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_ENDPOINT: ${{ secrets.AZURE_ENDPOINT }}
AZURE_CODE_SIGNING_NAME: ${{ secrets.AZURE_CODE_SIGNING_NAME }}
AZURE_CERT_PROFILE_NAME: ${{ secrets.AZURE_CERT_PROFILE_NAME }}

call-workflow-ant-app:
needs: [log-the-inputs, call-workflow-tarball]
Expand All @@ -87,16 +85,16 @@ jobs:
name_hdf5: ${{ inputs.name_tag5 }}
snap_name: HDFView-${{ needs.call-workflow-tarball.outputs.source_base }}
use_environ: release
secrets:
APPLE_CERTS_BASE64: ${{ secrets.APPLE_CERTS_BASE64 }}
APPLE_CERTS_BASE64_PASSWD: ${{ secrets.APPLE_CERTS_BASE64_PASSWD }}
KEYCHAIN_PASSWD: ${{ secrets.KEYCHAIN_PASSWD }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_ENDPOINT: ${{ secrets.AZURE_ENDPOINT }}
AZURE_CODE_SIGNING_NAME: ${{ secrets.AZURE_CODE_SIGNING_NAME }}
AZURE_CERT_PROFILE_NAME: ${{ secrets.AZURE_CERT_PROFILE_NAME }}
secrets:
APPLE_CERTS_BASE64: ${{ secrets.APPLE_CERTS_BASE64 }}
APPLE_CERTS_BASE64_PASSWD: ${{ secrets.APPLE_CERTS_BASE64_PASSWD }}
KEYCHAIN_PASSWD: ${{ secrets.KEYCHAIN_PASSWD }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_ENDPOINT: ${{ secrets.AZURE_ENDPOINT }}
AZURE_CODE_SIGNING_NAME: ${{ secrets.AZURE_CODE_SIGNING_NAME }}
AZURE_CERT_PROFILE_NAME: ${{ secrets.AZURE_CERT_PROFILE_NAME }}

call-workflow-release:
needs: [log-the-inputs, call-workflow-tarball, call-workflow-ant, call-workflow-ant-app]
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/tarball.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ on:
permissions:
contents: read

# A workflow run is made up of one or more jobs that can run sequentially or
# in parallel
jobs:
check_commits:
name: Check for recent commits
Expand Down Expand Up @@ -94,9 +92,10 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Get Sources
uses: actions/checkout@v4
uses: actions/checkout@v4.1.7
with:
path: hdfsrc
ref: '${{needs.check_commits.outputs.branch_ref }}'

- name: Read VERSION file
id: getversion
Expand Down
2 changes: 1 addition & 1 deletion src/org.hdfgroup.hdfview/hdf/view/HDFView.java
Original file line number Diff line number Diff line change
Expand Up @@ -2810,7 +2810,7 @@ else if ("-java.version".equalsIgnoreCase(args[i])) {
for (int i = args.length - j; i < args.length; i++) {
tmpFile = new File(args[i]);
if (!tmpFile.isAbsolute())
tmpFile = new File(rootDir, args[i]);
tmpFile = new File(startDir, args[i]);
log.trace("main: filelist - file = {} ", tmpFile.getAbsolutePath());
log.trace("main: filelist - add file = {} exists={} isFile={} isDir={}", tmpFile,
tmpFile.exists(), tmpFile.isFile(), tmpFile.isDirectory());
Expand Down

0 comments on commit 1b378f8

Please sign in to comment.