Build, test and upload .pkg to S3 #286
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build, test and upload .pkg to S3 | |
| # The scheduler runs at 9 am UTC every day. | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| ref_name: | |
| description: "name of git ref for which to build installer" | |
| required: true | |
| type: string | |
| workflow_call: | |
| inputs: | |
| ref_name: | |
| required: true | |
| type: string | |
| schedule: | |
| - cron: '0 9 * * *' | |
| env: | |
| GO111MODULE: on | |
| permissions: | |
| # This is required for configure-aws-credentials to request an OIDC JWT ID token to access AWS resources later on. | |
| # More info: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings | |
| id-token: write | |
| # This is required for actions/checkout | |
| contents: read | |
| jobs: | |
| get-tag-name: | |
| name: Get tag name | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| timeout-minutes: 2 | |
| outputs: | |
| tag: ${{ steps.check-tag.outputs.tag }} | |
| commit: ${{ steps.export-commit.outputs.commit }} | |
| steps: | |
| - name: Check tag from workflow input and github ref | |
| id: check-tag | |
| run: | | |
| if [ -n "${{ inputs.ref_name }}" ]; then | |
| tag=${{ inputs.ref_name }} | |
| else | |
| tag=${{ github.ref_name }} | |
| fi | |
| echo "using tag=${tag}" | |
| echo "tag=$tag" >> ${GITHUB_OUTPUT} | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| ref: ${{ steps.check-tag.outputs.tag }} | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| submodules: true | |
| - name: Export commit hash | |
| id: export-commit | |
| run: | | |
| commit=$(git rev-parse HEAD) | |
| echo "using commit=${commit}" | |
| echo "commit=$commit" >> ${GITHUB_OUTPUT} | |
| macos-aarch64-pkg-build: | |
| needs: get-tag-name | |
| uses: ./.github/workflows/build-pkg.yaml | |
| permissions: | |
| # This is required for configure-aws-credentials to request an OIDC JWT ID token to access AWS resources later on. | |
| # More info: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings | |
| id-token: write | |
| # This is required for actions/checkout | |
| contents: read | |
| secrets: inherit | |
| with: | |
| os: macos | |
| arch: arm64 | |
| output_arch: aarch64 | |
| version: 14 | |
| tag: ${{ needs.get-tag-name.outputs.tag }} | |
| commit: ${{ needs.get-tag-name.outputs.commit }} | |
| macos-x86-64-pkg-build: | |
| needs: get-tag-name | |
| uses: ./.github/workflows/build-pkg.yaml | |
| permissions: | |
| # This is required for configure-aws-credentials to request an OIDC JWT ID token to access AWS resources later on. | |
| # More info: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings | |
| id-token: write | |
| # This is required for actions/checkout | |
| contents: read | |
| secrets: inherit | |
| with: | |
| os: macos | |
| arch: amd64 | |
| output_arch: x86_64 | |
| version: 14 | |
| tag: ${{ needs.get-tag-name.outputs.tag }} | |
| commit: ${{ needs.get-tag-name.outputs.commit }} | |
| macos-aarch64-pkg-test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: [13, 14] | |
| needs: | |
| - get-tag-name | |
| - macos-aarch64-pkg-build | |
| uses: ./.github/workflows/test-pkg.yaml | |
| permissions: | |
| # This is required for configure-aws-credentials to request an OIDC JWT ID token to access AWS resources later on. | |
| # More info: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings | |
| id-token: write | |
| # This is required for actions/checkout | |
| contents: read | |
| secrets: inherit | |
| with: | |
| os: macos | |
| arch: arm64 | |
| output_arch: aarch64 | |
| version: ${{ matrix.version }} | |
| tag: ${{ needs.get-tag-name.outputs.tag }} | |
| commit: ${{ needs.get-tag-name.outputs.commit }} | |
| macos-x86-64-pkg-test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: [13, 14] | |
| needs: | |
| - get-tag-name | |
| - macos-x86-64-pkg-build | |
| uses: ./.github/workflows/test-pkg.yaml | |
| permissions: | |
| # This is required for configure-aws-credentials to request an OIDC JWT ID token to access AWS resources later on. | |
| # More info: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings | |
| id-token: write | |
| # This is required for actions/checkout | |
| contents: read | |
| secrets: inherit | |
| with: | |
| os: macos | |
| arch: amd64 | |
| output_arch: x86_64 | |
| version: ${{ matrix.version }} | |
| tag: ${{ needs.get-tag-name.outputs.tag }} | |
| commit: ${{ needs.get-tag-name.outputs.commit }} |