fix(ci): lowercase image name for GHCR compatibility #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: Release | |
| on: | |
| push: | |
| tags: ['v*', '!stdlib/v*'] | |
| permissions: | |
| packages: write | |
| contents: read | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE: ghcr.io/${{ github.repository_owner }}/function-starlark | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| - run: go test -race -count=1 ./... | |
| release: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Extract version and image name | |
| id: version | |
| run: | | |
| echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" | |
| echo "image=$(echo '${{ env.IMAGE }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" | |
| - name: Build and push runtime image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| tags: | | |
| ${{ steps.version.outputs.image }}:${{ steps.version.outputs.tag }} | |
| ${{ steps.version.outputs.image }}:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Install crossplane CLI | |
| run: | | |
| XP_CHANNEL=stable XP_VERSION=v1.20.0 curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh | |
| sudo mv crossplane /usr/local/bin/ | |
| - name: Generate input CRD | |
| run: make generate | |
| - name: Build and push xpkg | |
| run: | | |
| crossplane xpkg build \ | |
| -f package \ | |
| --embed-runtime-image=${{ steps.version.outputs.image }}:${{ steps.version.outputs.tag }} \ | |
| -o function-starlark.xpkg | |
| crossplane xpkg push \ | |
| -f function-starlark.xpkg \ | |
| ${{ steps.version.outputs.image }}:${{ steps.version.outputs.tag }}-xpkg |