Repository navigation
Merge debian-topn (App-token fix) into arm64 release leg to refresh CI #2202
Workflow file for this run
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 Package | |
| env: | |
| MAIN_BRANCH: "debian-topn" | |
| PACKAGE_CLOUD_REPO_NAME: "citusdata/community" | |
| PACKAGE_CLOUD_API_TOKEN: ${{ secrets.PACKAGE_CLOUD_API_TOKEN }} | |
| PACKAGING_SECRET_KEY: ${{ secrets.PACKAGING_SECRET_KEY }} | |
| PACKAGING_PASSPHRASE: ${{ secrets.PACKAGING_PASSPHRASE }} | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| workflow_dispatch: | |
| jobs: | |
| build_package: | |
| name: Build package | |
| # arm64 legs run on native ARM64 runners; amd64 stays on ubuntu-latest. | |
| runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: | |
| - debian/bullseye | |
| - debian/bookworm | |
| - debian/trixie | |
| - ubuntu/jammy | |
| - ubuntu/noble | |
| # arm64 debs are gated behind the DEB_BUILD_MULTI_ARCH repo variable | |
| # (default OFF -> amd64 only, so the existing release pipeline is unchanged). | |
| arch: ${{ fromJSON(vars.DEB_BUILD_MULTI_ARCH == 'true' && '["amd64", "arm64"]' || '["amd64"]') }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - uses: actions/create-github-app-token@v3 | |
| id: app-token | |
| with: | |
| app-id: ${{ vars.GH_APP_ID }} | |
| private-key: ${{ secrets.GH_APP_KEY }} | |
| owner: citusdata | |
| - name: Export app token to environment | |
| run: | | |
| echo "GH_TOKEN=${{ steps.app-token.outputs.token }}" >> $GITHUB_ENV | |
| echo "GITHUB_TOKEN=${{ steps.app-token.outputs.token }}" >> $GITHUB_ENV | |
| - name: Clone tools branch | |
| run: git clone -b v0.8.36 --depth=1 https://github.com/citusdata/tools.git tools | |
| - name: Install package dependencies | |
| run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev python3-testresources | |
| - name: Install python requirements | |
| run: python -m pip install -r tools/packaging_automation/requirements.txt | |
| # The arm64 builder/signer images are not published to Docker Hub yet, so | |
| # build them natively in-job by cloning develop's tooling (this branch has | |
| # none). "docker run" prefers a local image, so citus_package picks these up | |
| # automatically; amd64 keeps pulling the published images from Docker Hub. | |
| - name: Login to Docker Hub | |
| if: matrix.arch == 'arm64' | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USER_NAME }} | |
| password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
| - name: Build arm64 builder image | |
| if: matrix.arch == 'arm64' | |
| run: | | |
| git clone -b develop --depth=1 https://github.com/citusdata/packaging.git tooling | |
| cd tooling | |
| export TEST=false | |
| export TARGET_PLATFORM="${PLATFORM/\//,}" | |
| ./update_image | |
| env: | |
| PLATFORM: ${{ matrix.platform }} | |
| - name: Build arm64 debsigner image | |
| if: matrix.arch == 'arm64' | |
| run: docker build -t citusdata/packaging:debsigner -f tooling/dockerfiles/debsigner/Dockerfile tooling | |
| - name: Build packages | |
| run: | | |
| python -m tools.packaging_automation.citus_package \ | |
| --gh_token "${GH_TOKEN}" \ | |
| --platform "${{ matrix.platform }}" \ | |
| --build_type "release" \ | |
| --secret_key "${PACKAGING_SECRET_KEY}" \ | |
| --passphrase "${PACKAGING_PASSPHRASE}" \ | |
| --output_dir "$(pwd)/packages/" \ | |
| --input_files_dir "$(pwd)" \ | |
| --output_validation | |
| - name: Publish packages | |
| run: | | |
| python -m tools.packaging_automation.upload_to_package_cloud \ | |
| --platform "${{ matrix.platform }}" \ | |
| --package_cloud_api_token "${PACKAGE_CLOUD_API_TOKEN}" \ | |
| --repository_name "${PACKAGE_CLOUD_REPO_NAME}" \ | |
| --output_file_path "$(pwd)/packages" \ | |
| --current_branch "${GITHUB_REF##*/}" \ | |
| --main_branch "${MAIN_BRANCH}" |