summaryrefslogtreecommitdiffstats
path: root/.github/workflows/release.yml
blob: 54c9a674950e0a100bf446db0f76894ce2d82189 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: hdf5 1.14 release build

# Controls when the action will run. Triggers the workflow on a manual run
on:
  workflow_dispatch:
    inputs:
      use_tag:
        description: 'Release version tag'
        type: string
        required: false
        default: snapshot-1.14

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
    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@v4.1.1
        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@v4
        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@v4
        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: create-files-ctest
    uses: ./.github/workflows/cmake-ctest.yml
    with:
      file_base: ${{ needs.create-files-ctest.outputs.file_base }}
      preset_name: ci-StdShar

  call-workflow-abi:
    needs: [log-the-inputs, create-files-ctest, call-workflow-ctest]
    uses: ./.github/workflows/abi-report.yml
    with:
      file_ref: '1_14_3'
      file_base: ${{ needs.create-files-ctest.outputs.file_base }}
      use_tag: ${{ needs.log-the-inputs.outputs.rel_tag }}
      use_environ: release

  call-workflow-release:
    needs: [log-the-inputs, create-files-ctest, call-workflow-ctest, call-workflow-abi]
    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