Merge pull request #118 from Sharpie/add-setup-osuosl-ca #1
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 an OpenVox ezbake project | ||
|
Check failure on line 1 in .github/workflows/build_ezbake.yml
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| ref: | ||
| description: 'Tag to build' | ||
| required: true | ||
| type: string | ||
| deb_platform_list: | ||
| description: 'A comma-separated list of deb-based platforms to build for, excluding the architecture (e.g. ubuntu-24.04,debian-12). Do not include spaces. If not provided, will use the default list of platforms supported by OpenVox Server and DB.' | ||
| required: false | ||
| type: string | ||
| rpm_platform_list: | ||
| description: 'A comma-separated list of rpm-based platforms to build for, excluding the architecture (e.g. el-9,amazon-2023). Do not include spaces. If not provided, will use the default list of platforms supported by OpenVox Server and DB.' | ||
| required: false | ||
| type: string | ||
| ezbake-ref: | ||
| description: |- | ||
| Branch/tag from ezbake that will be used for openvoxdb/server builds. | ||
| type: string | ||
| required: false | ||
| ezbake-ver: | ||
| description: 'The version specified in project.clj in the given ezbake-ref. Will default to the version found in project.clj in the repo if not specified.' | ||
| type: string | ||
| required: false | ||
| branch: | ||
| description: 'Release branch being built. Used for repo checkout and default platform list.' | ||
| type: string | ||
| required: false | ||
| default: 'main' | ||
| env: | ||
| ENDPOINT_URL: ${{ secrets.S3_ENDPOINT_URL }} | ||
| BUCKET_NAME: ${{ secrets.S3_ARTIFACTS_BUCKET_NAME }} | ||
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
| # https://github.com/boto/boto3/issues/4398#issuecomment-2619946229 | ||
| AWS_REQUEST_CHECKSUM_CALCULATION: "WHEN_REQUIRED" | ||
| AWS_RESPONSE_CHECKSUM_VALIDATION: "WHEN_REQUIRED" | ||
| EZBAKE_BRANCH: ${{ inputs.ezbake-ref }} | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 600 | ||
| strategy: | ||
| fail-fast: false | ||
| steps: | ||
| # This checks out the release branch, because the vox:build task will | ||
| # check out the tag itself. | ||
| - name: Checkout code | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| ref: ${{ inputs.branch }} | ||
| - name: Checkout platform config | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| repository: OpenVoxProject/shared-actions | ||
| ref: main | ||
| path: .shared-actions | ||
| sparse-checkout: platforms.json | ||
| sparse-checkout-cone-mode: false | ||
| - name: Resolve platform lists | ||
| env: | ||
| DEB_PLATFORMS: ${{ inputs.deb_platform_list }} | ||
| RPM_PLATFORMS: ${{ inputs.rpm_platform_list }} | ||
| BRANCH: ${{ inputs.branch }} | ||
| run: | | ||
| echo "DEB_PLATFORMS=${DEB_PLATFORMS:-$(jq -r --arg branch "${BRANCH}" '.[$branch]."ezbake-deb" | join(",")' .shared-actions/platforms.json)}" >> $GITHUB_ENV | ||
| echo "RPM_PLATFORMS=${RPM_PLATFORMS:-$(jq -r --arg branch "${BRANCH}" '.[$branch]."ezbake-rpm" | join(",")' .shared-actions/platforms.json)}" >> $GITHUB_ENV | ||
| - name: Install Ruby | ||
| uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0 | ||
| with: | ||
| ruby-version: '4.0' | ||
| bundler-cache: true | ||
| - id: docker-cache | ||
| uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | ||
| with: | ||
| path: /tmp/ezbake-builder.tar | ||
| key: docker-ezbake-${{ hashFiles('Dockerfile') }} | ||
| - name: Load or build Docker image | ||
| run: | | ||
| if [[ -f /tmp/ezbake-builder.tar ]]; then | ||
| docker load -i /tmp/ezbake-builder.tar | ||
| else | ||
| docker build -t ezbake-builder . | ||
| docker save ezbake-builder -o /tmp/ezbake-builder.tar | ||
| fi | ||
| - uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | ||
| if: always() && steps.docker-cache.outputs.cache-hit != 'true' | ||
| with: | ||
| path: /tmp/ezbake-builder.tar | ||
| key: docker-ezbake-${{ hashFiles('Dockerfile') }} | ||
| - name: Update awscli | ||
| run: | | ||
| python -m pip install --upgrade awscli | ||
| - name: Set EZBAKE_VERSION if provided | ||
| if: ${{ inputs.ezbake-ver != '' }} | ||
| env: | ||
| EZBAKE_VER: ${{ inputs.ezbake-ver }} | ||
| run: echo "EZBAKE_VERSION=${EZBAKE_VER}" >> $GITHUB_ENV | ||
| - name: Run build script | ||
| env: | ||
| BUILD_REF: ${{ inputs.ref }} | ||
| run: | | ||
| rm -rf output | ||
| bundle exec rake "vox:build[${BUILD_REF}]" | ||
| - name: Configure OSUOSL CA Certificate for S3 | ||
| if: contains(secrets.S3_ENDPOINT_URL, "s3.osuosl.org") | ||
| uses: ./.github/actions/setup-osuosl-ca | ||
| - name: Upload output to S3 | ||
| run: | | ||
| bundle exec rake vox:upload | ||