|
6 | 6 | workflow_dispatch: |
7 | 7 | inputs: |
8 | 8 | base_version: |
9 | | - description: "Select the OpenJDK version to build (leave empty to build all versions)" |
| 9 | + description: "OpenJDK version to build (leave empty to build all)" |
10 | 10 | required: false |
11 | 11 | default: "" |
12 | 12 |
|
|
18 | 18 | obaas-image: |
19 | 19 | strategy: |
20 | 20 | matrix: |
21 | | - base_version: [17, 21, 24] |
| 21 | + base_version: ${{ github.event.inputs.base_version != '' && [ github.event.inputs.base_version ] || [17,21,24] }} |
22 | 22 | runs-on: ubuntu-latest |
23 | 23 | permissions: |
24 | 24 | packages: write |
|
35 | 35 | username: ${{ github.actor }} |
36 | 36 | password: ${{ secrets.GITHUB_TOKEN }} |
37 | 37 |
|
38 | | - - name: Determine OpenJDK version |
39 | | - id: version |
40 | | - run: | |
41 | | - if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ -n "${{ github.event.inputs.base_version }}" ]; then |
42 | | - echo "Using manual version ${{ github.event.inputs.base_version }}" |
43 | | - echo "VERSION=${{ github.event.inputs.base_version }}" >> $GITHUB_ENV |
44 | | - else |
45 | | - echo "Using matrix version ${{ matrix.base_version }}" |
46 | | - echo "VERSION=${{ matrix.base_version }}" >> $GITHUB_ENV |
47 | | - fi |
48 | | -
|
49 | 38 | - name: Get latest Image Software Digest |
50 | 39 | run: | |
51 | | - latest_digest=$(docker run --rm --entrypoint cat ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ env.VERSION }} /image_digest || true) |
| 40 | + latest_digest=$(docker run --rm --entrypoint cat ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ matrix.base_version }} /image_digest || true) |
52 | 41 | echo "Current Digest: $latest_digest" |
53 | 42 | echo "latest_digest=$latest_digest" >> $GITHUB_ENV |
54 | 43 | continue-on-error: true |
|
57 | 46 | if: github.event_name == 'workflow_dispatch' || env.latest_digest == '' |
58 | 47 | uses: ./.github/actions/process-image-openjdk |
59 | 48 | with: |
60 | | - src_image: container-registry.oracle.com/java/openjdk:${{ env.VERSION }} |
61 | | - dst_image: ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ env.VERSION }} |
| 49 | + src_image: container-registry.oracle.com/java/openjdk:${{ matrix.base_version }} |
| 50 | + dst_image: ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ matrix.base_version }} |
62 | 51 | description: ${{ env.description }} |
63 | 52 | push: true |
64 | 53 | pkg_command: dnf |
|
0 commit comments