|
1 | | -name: Create operator's container image for the new release |
| 1 | +name: Build and publish release containers to quay.io |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | release: |
|
9 | 9 | inputs: |
10 | 10 | version: |
11 | 11 | type: string |
12 | | - description: 'SemVer for the new release.' |
| 12 | + description: 'Version (Semating Versioning) for the new release. E.g: 0.0.1' |
13 | 13 | required: true |
14 | | - default: 'v0.0.1' |
| 14 | + default: '0.0.1' |
| 15 | + |
15 | 16 | env: |
16 | 17 | REGISTRY: quay.io |
| 18 | + REGISTRY_USER: testnetworkfunction |
| 19 | + REPO_BASE_NAME: cnf-certsuite-operator |
| 20 | + |
17 | 21 | TERM: xterm-color |
18 | 22 |
|
19 | 23 | jobs: |
20 | | - set_release_version: |
21 | | - name: Set release version. |
| 24 | + publish_new_version: |
| 25 | + name: Build and publish release containers to quay.io |
22 | 26 | runs-on: ubuntu-22.04 |
23 | 27 | env: |
24 | 28 | SHELL: /bin/bash |
25 | 29 |
|
26 | | - outputs: |
27 | | - release_tag: ${{ steps.set_release.release_tag }} |
28 | | - |
29 | 30 | steps: |
30 | 31 | - name: Set release version output var depending on the trigger type. |
31 | 32 | id: set_release |
32 | 33 | run: | |
33 | | - if ${GITHUB_EVENT_NAME} == "workflow_dispatch"; then |
| 34 | + if [ ${GITHUB_EVENT_NAME} == "workflow_dispatch" ]; then |
34 | 35 | echo "Manually triggered workflow to make release ${{ inputs.version }}" |
35 | | - echo "release_tag=${{ inputs.version }}" >> ${GITHUB_OUTPUT} |
| 36 | + VERSION=${{ inputs.version }} |
| 37 | + echo "VERSION=${VERSION}" >> ${GITHUB_ENV} |
36 | 38 | else |
37 | 39 | echo "New release published: ${{ github.ref_name }}" |
38 | | - echo "release_tag=${{ github.ref_name }}" >> ${GITHUB_OUTPUT} |
| 40 | + echo "VERSION=${{ github.ref_name }}" >> ${GITHUB_ENV} |
39 | 41 | fi |
40 | 42 |
|
41 | | - publish_new_version: |
42 | | - needs: set_release_version |
43 | | - name: Build and publish new version |
44 | | - runs-on: ubuntu-22.04 |
45 | | - env: |
46 | | - SHELL: /bin/bash |
47 | | - VERSION: ${{ needs.set_release_version.outputs.release_tag }} |
48 | | - USERNAME: testnetworkfunction |
49 | | - REPO: ${REGISTRY}/${USERNAME}/cnf-certsuite-operator |
50 | | - IMG: ${REPO}:v${VERSION} |
51 | | - SIDECAR_IMG: ${REPO}-sidecar:v${VERSION} |
52 | | - BUNDLE_IMG: ${REPO}-bundle:v${VERSION} |
53 | | - CATALOG_IMG: ${REPO}-catalog:v${VERSION} |
| 43 | + REPO=${REGISTRY}/${REGISTRY_USER}/${REPO_BASE_NAME} |
| 44 | +
|
| 45 | + echo "IMG=${REPO}:v${VERSION}" >> ${GITHUB_ENV} |
| 46 | + echo "SIDECAR_IMG=${REPO}-sidecar:v${VERSION}" >> ${GITHUB_ENV} |
| 47 | + echo "BUNDLE_IMG=${REPO}-bundle:v${VERSION}" >> ${GITHUB_ENV} |
| 48 | + echo "CATALOG_IMG=${REPO}-catalog:v${VERSION}" >> ${GITHUB_ENV} |
54 | 49 |
|
55 | | - steps: |
56 | 50 | - name: Print release images versions |
57 | 51 | run: | |
58 | 52 | echo "Release version to build: ${VERSION}" |
|
0 commit comments