Merge pull request #31 from AI4quantum/windoze-release-ci #2
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: Maestro Knowledge Build and Upload Images | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| build-upload: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - arch: x86_64 | |
| runner: ubuntu-latest | |
| - arch: arm64 | |
| runner: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runner }} | |
| permissions: | |
| packages: write | |
| outputs: | |
| version: ${{ steps.version.outputs.version }} | |
| steps: | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/checkout@v4 | |
| - name: get release version | |
| id: version | |
| run: | | |
| VERSION=$(grep -E '^(version|tool\.poetry\.version) *= *"[^"]+"' "pyproject.toml" | \ | |
| head -n 1 | \ | |
| sed -E 's/.*"([^"]+)".*/\1/') | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: get docker-compatible GITHUB_ORG | |
| id: org | |
| run: | | |
| echo "github_org=${OWNER,,}" >>${GITHUB_OUTPUT} | |
| env: | |
| OWNER: '${{ github.repository_owner }}' | |
| - name: build and push docker image to ghcr.io | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| tags: ghcr.io/${{ steps.org.outputs.github_org }}/maestro-knowledge:${{ steps.version.outputs.version }}-${{ matrix.arch }} | |
| upload-manifest: | |
| needs: build-upload | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| steps: | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: get docker-compatible GITHUB_ORG | |
| run: | | |
| echo "GITHUB_ORG=${OWNER,,}" >>${GITHUB_ENV} | |
| env: | |
| OWNER: '${{ github.repository_owner }}' | |
| - name: Push multi-arch image to ghcr.io | |
| run: | | |
| docker manifest create ghcr.io/$GITHUB_ORG/maestro-knowledge:${{ needs.build-upload.outputs.version }} \ | |
| --amend ghcr.io/$GITHUB_ORG/maestro-knowledge:${{ needs.build-upload.outputs.version }}-x86_64 \ | |
| --amend ghcr.io/$GITHUB_ORG/maestro-knowledge:${{ needs.build-upload.outputs.version }}-arm64 && | |
| docker manifest create ghcr.io/$GITHUB_ORG/maestro-knowledge:latest \ | |
| --amend ghcr.io/$GITHUB_ORG/maestro-knowledge:${{ needs.build-upload.outputs.version }}-x86_64 \ | |
| --amend ghcr.io/$GITHUB_ORG/maestro-knowledge:${{ needs.build-upload.outputs.version }}-arm64 && | |
| docker manifest push ghcr.io/$GITHUB_ORG/maestro-knowledge:${{ needs.build-upload.outputs.version }} | |
| docker manifest push ghcr.io/$GITHUB_ORG/maestro-knowledge:latest |