cloudsmith-package-synchronised #4950
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 Nightly Image | |
| on: | |
| repository_dispatch: | |
| types: | |
| - cloudsmith-package-synchronised | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build-nightly-docker-image: | |
| if: | | |
| github.event.client_payload.data.repository == 'nightlies' && | |
| (github.event.client_payload.data.name == 'ponyc-x86-64-unknown-linux-alpine3.23.tar.gz' || | |
| github.event.client_payload.data.name == 'ponyc-arm64-unknown-linux-alpine3.23.tar.gz') | |
| concurrency: | |
| group: build-nightly-image | |
| cancel-in-progress: true | |
| name: Build nightly image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.2 | |
| - name: Set up Docker Buildx | |
| # v3.10.0 | |
| uses: docker/setup-buildx-action@v4 | |
| with: | |
| version: v0.23.0 | |
| - name: Login to GitHub Container Registry | |
| # v2.2.0 | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| run: bash .dockerfiles/nightly/build-and-push.bash | |
| - name: Alert on failure | |
| if: ${{ failure() }} | |
| uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 | |
| with: | |
| api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }} | |
| email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }} | |
| organization-url: 'https://ponylang.zulipchat.com/' | |
| to: notifications | |
| type: stream | |
| topic: ${{ github.repository }} scheduled job failure | |
| content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed. | |
| update-stdlib-builder-image-on-nightly: | |
| needs: | |
| - build-nightly-docker-image | |
| name: Update stdlib-builder Docker image with nightly ponyc version | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| - name: Login to GitHub Container Registry | |
| # v2.2.0 | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| run: bash .ci-dockerfiles/stdlib-builder/build-and-push.bash | |
| - name: Alert on failure | |
| if: ${{ failure() }} | |
| uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 | |
| with: | |
| api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }} | |
| email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }} | |
| organization-url: 'https://ponylang.zulipchat.com/' | |
| to: notifications | |
| type: stream | |
| topic: ${{ github.repository }} scheduled job failure | |
| content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed. | |
| test-building-stdlib-documentation: | |
| needs: | |
| - update-stdlib-builder-image-on-nightly | |
| name: Test building standard library documentation | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/ponylang/ponyc-ci-stdlib-builder:nightly | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| - name: Build | |
| run: "bash .ci-scripts/build-stdlib-documentation.bash" | |
| - name: Alert on failure | |
| if: ${{ failure() }} | |
| uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 | |
| with: | |
| api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }} | |
| email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }} | |
| organization-url: 'https://ponylang.zulipchat.com/' | |
| to: notifications | |
| type: stream | |
| topic: ${{ github.repository }} scheduled job failure | |
| content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed. | |
| prune-untagged-nightly-images: | |
| needs: | |
| - build-nightly-docker-image | |
| name: Prune untagged nightly images | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Login to GitHub Container Registry | |
| # v2.2.0 | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Fetch multi-platform image SHAs to preserve | |
| id: multi-arch-digests | |
| run: | | |
| shas="" | |
| for tag in nightly release; do | |
| digests=$(docker manifest inspect "ghcr.io/ponylang/ponyc:${tag}" 2>/dev/null | jq -r '.manifests[].digest' | paste -s -d ',' - || true) | |
| if [ -n "$digests" ]; then | |
| shas="${shas:+${shas},}${digests}" | |
| fi | |
| done | |
| echo "skip-shas=${shas}" >> $GITHUB_OUTPUT | |
| - name: Prune | |
| # v3.0.1 | |
| uses: snok/container-retention-policy@3b0972b2276b171b212f8c4efbca59ebba26eceb | |
| with: | |
| account: ponylang | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| image-names: ponyc | |
| tag-selection: untagged | |
| cut-off: 1d | |
| skip-shas: ${{ steps.multi-arch-digests.outputs.skip-shas }} | |
| - name: Alert on failure | |
| if: ${{ failure() }} | |
| uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 | |
| with: | |
| api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }} | |
| email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }} | |
| organization-url: 'https://ponylang.zulipchat.com/' | |
| to: notifications | |
| type: stream | |
| topic: ${{ github.repository }} scheduled job failure | |
| content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed. | |
| prune-untagged-stdlib-builders: | |
| needs: | |
| - update-stdlib-builder-image-on-nightly | |
| name: Prune untagged stdlib builders | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Prune | |
| # v3.0.1 | |
| uses: snok/container-retention-policy@3b0972b2276b171b212f8c4efbca59ebba26eceb | |
| with: | |
| account: ponylang | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| image-names: ponyc-ci-stdlib-builder | |
| tag-selection: untagged | |
| cut-off: 1d | |
| - name: Alert on failure | |
| if: ${{ failure() }} | |
| uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 | |
| with: | |
| api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }} | |
| email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }} | |
| organization-url: 'https://ponylang.zulipchat.com/' | |
| to: notifications | |
| type: stream | |
| topic: ${{ github.repository }} scheduled job failure | |
| content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed. | |
| send-nightly-image-pushed-event: | |
| needs: | |
| - build-nightly-docker-image | |
| name: Send | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| repo: | |
| - ponylang/library-documentation-action-v2 | |
| - ponylang/shared-docker | |
| steps: | |
| - name: Send | |
| # v2.1.1 | |
| uses: peter-evans/repository-dispatch@8324ecf35877f9b02961dd5aaf43ed7be7db9373 | |
| with: | |
| token: ${{ secrets.PONYLANG_MAIN_API_TOKEN }} | |
| repository: ${{ matrix.repo }} | |
| event-type: ponyc-nightly-image-pushed | |
| client-payload: '{"version": "${{ github.event.client_payload.data.version }}"}' | |
| - name: Alert on failure | |
| if: ${{ failure() }} | |
| uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 | |
| with: | |
| api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }} | |
| email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }} | |
| organization-url: 'https://ponylang.zulipchat.com/' | |
| to: notifications | |
| type: stream | |
| topic: ${{ github.repository }} scheduled job failure | |
| content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed. |