Add new workflow triggers #5
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 Python Interpreters | |
| on: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: '0 */12 * * *' # Every 12 hours | |
| workflow_dispatch: | |
| jobs: | |
| build-base: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Github Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Python builder base | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./Dockerfile.base | |
| push: true | |
| cache-to: type=inline | |
| cache-from: type=registry,ref=ghcr.io/python-discord/python-builds:builder-base | |
| tags: ghcr.io/python-discord/python-builds:builder-base | |
| resolve-versions: | |
| runs-on: ubuntu-latest | |
| needs: build-base | |
| outputs: | |
| resolved_versions: ${{ steps.resolve_versions.outputs.resolved_versions }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Run Docker container to resolve versions | |
| id: resolve_versions | |
| run: | | |
| resolved_versions=$(docker run --mount type=bind,src=./versions.toml,dst=/versions.toml --rm ghcr.io/python-discord/python-builds:builder-base python3 /scripts/find_version.py) | |
| # JSON array with objects containing "tag" and "version" keys | |
| echo "resolved_versions=$resolved_versions" >> $GITHUB_OUTPUT | |
| build-versions: | |
| needs: [build-base, resolve-versions] | |
| strategy: | |
| matrix: | |
| version_info: ${{ fromJson(needs.resolve-versions.outputs.resolved_versions) }} | |
| uses: ./.github/workflows/build-version.yml | |
| with: | |
| version: ${{ matrix.version_info.version }} | |
| tag: ${{ matrix.version_info.tag }} |