|
| 1 | +name: sam release code |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + STACK_NAME: |
| 7 | + required: true |
| 8 | + type: string |
| 9 | + ARTIFACT_BUCKET_PREFIX: |
| 10 | + required: true |
| 11 | + type: string |
| 12 | + TARGET_ENVIRONMENT: |
| 13 | + required: true |
| 14 | + type: string |
| 15 | + BUILD_ARTIFACT: |
| 16 | + required: true |
| 17 | + type: string |
| 18 | + VERSION_NUMBER: |
| 19 | + required: true |
| 20 | + type: string |
| 21 | + COMMIT_ID: |
| 22 | + required: true |
| 23 | + type: string |
| 24 | + LOG_LEVEL: |
| 25 | + required: true |
| 26 | + type: string |
| 27 | + LOG_RETENTION_DAYS: |
| 28 | + required: true |
| 29 | + type: string |
| 30 | + CREATE_INT_RELEASE_NOTES: |
| 31 | + type: boolean |
| 32 | + default: false |
| 33 | + CREATE_INT_RC_RELEASE_NOTES: |
| 34 | + type: boolean |
| 35 | + default: false |
| 36 | + CREATE_PROD_RELEASE_NOTES: |
| 37 | + type: boolean |
| 38 | + default: false |
| 39 | + MARK_JIRA_RELEASED: |
| 40 | + type: boolean |
| 41 | + default: false |
| 42 | + secrets: |
| 43 | + CLOUD_FORMATION_DEPLOY_ROLE: |
| 44 | + required: true |
| 45 | + DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE: |
| 46 | + required: false |
| 47 | + INT_CLOUD_FORMATION_CHECK_VERSION_ROLE: |
| 48 | + required: false |
| 49 | + PROD_CLOUD_FORMATION_CHECK_VERSION_ROLE: |
| 50 | + required: false |
| 51 | + DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE: |
| 52 | + required: false |
| 53 | + |
| 54 | +jobs: |
| 55 | + sam_release_code: |
| 56 | + runs-on: ubuntu-latest |
| 57 | + environment: ${{ inputs.TARGET_ENVIRONMENT }} |
| 58 | + permissions: |
| 59 | + id-token: write |
| 60 | + contents: read |
| 61 | + |
| 62 | + steps: |
| 63 | + - name: Checkout local github actions |
| 64 | + uses: actions/checkout@v4 |
| 65 | + with: |
| 66 | + ref: ${{ env.BRANCH_NAME }} |
| 67 | + fetch-depth: 0 |
| 68 | + sparse-checkout: | |
| 69 | + .github |
| 70 | +
|
| 71 | + - name: create_int_rc_release_notes |
| 72 | + uses: ./.github/actions/update_confluence_jira |
| 73 | + if: ${{ inputs.CREATE_INT_RC_RELEASE_NOTES == true }} |
| 74 | + with: |
| 75 | + TARGET_ENVIRONMENT: int |
| 76 | + RELEASE_TAG: ${{ inputs.VERSION_NUMBER }} |
| 77 | + CONFLUENCE_PAGE_ID: "778783127" |
| 78 | + CREATE_RC_RELEASE_NOTES: true |
| 79 | + DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE }} |
| 80 | + TARGET_CLOUD_FORMATION_CHECK_VERSION_ROLE: ${{ secrets.INT_CLOUD_FORMATION_CHECK_VERSION_ROLE }} |
| 81 | + DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE }} |
| 82 | + |
| 83 | + - name: Configure AWS Credentials |
| 84 | + uses: aws-actions/configure-aws-credentials@v4 |
| 85 | + with: |
| 86 | + aws-region: eu-west-2 |
| 87 | + role-to-assume: ${{ secrets.CLOUD_FORMATION_DEPLOY_ROLE }} |
| 88 | + role-session-name: github-actions |
| 89 | + |
| 90 | + - name: download build artifact |
| 91 | + uses: actions/download-artifact@v4 |
| 92 | + with: |
| 93 | + name: ${{ inputs.BUILD_ARTIFACT }} |
| 94 | + path: . |
| 95 | + |
| 96 | + - name: release code |
| 97 | + shell: bash |
| 98 | + working-directory: .github/scripts |
| 99 | + env: |
| 100 | + artifact_bucket_prefix: fhir_validator/${{ inputs.ARTIFACT_BUCKET_PREFIX }} |
| 101 | + COMMIT_ID: ${{ inputs.COMMIT_ID }} |
| 102 | + LOG_LEVEL: ${{ inputs.LOG_LEVEL }} |
| 103 | + LOG_RETENTION_DAYS: ${{ inputs.LOG_RETENTION_DAYS }} |
| 104 | + stack_name: ${{ inputs.STACK_NAME }} |
| 105 | + TARGET_ENVIRONMENT: ${{ inputs.TARGET_ENVIRONMENT }} |
| 106 | + template_file: template.yaml |
| 107 | + VERSION_NUMBER: ${{ inputs.VERSION_NUMBER }} |
| 108 | + run: ./release_code.sh |
| 109 | + |
| 110 | + - name: create_int_release_notes |
| 111 | + uses: ./.github/actions/update_confluence_jira |
| 112 | + if: ${{ inputs.CREATE_INT_RELEASE_NOTES == true && always() && !failure() && !cancelled() }} |
| 113 | + with: |
| 114 | + TARGET_ENVIRONMENT: int |
| 115 | + CONFLUENCE_PAGE_ID: "778783122" |
| 116 | + CREATE_RC_RELEASE_NOTES: false |
| 117 | + DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE }} |
| 118 | + TARGET_CLOUD_FORMATION_CHECK_VERSION_ROLE: ${{ secrets.INT_CLOUD_FORMATION_CHECK_VERSION_ROLE }} |
| 119 | + DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE }} |
| 120 | + |
| 121 | + - name: create_prod_release_notes |
| 122 | + uses: ./.github/actions/update_confluence_jira |
| 123 | + if: ${{ inputs.CREATE_PROD_RELEASE_NOTES == true && always() && !failure() && !cancelled() }} |
| 124 | + with: |
| 125 | + TARGET_ENVIRONMENT: prod |
| 126 | + CONFLUENCE_PAGE_ID: "778783125" |
| 127 | + CREATE_RC_RELEASE_NOTES: false |
| 128 | + DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE }} |
| 129 | + TARGET_CLOUD_FORMATION_CHECK_VERSION_ROLE: ${{ secrets.PROD_CLOUD_FORMATION_CHECK_VERSION_ROLE }} |
| 130 | + DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE }} |
| 131 | + |
| 132 | + - name: mark_released_in_jira |
| 133 | + uses: ./.github/actions/mark_jira_released |
| 134 | + if: ${{ inputs.MARK_JIRA_RELEASED == true && always() && !failure() && !cancelled() }} |
| 135 | + with: |
| 136 | + RELEASE_TAG: ${{ inputs.VERSION_NUMBER }} |
| 137 | + DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE }} |
0 commit comments