Repository navigation
Bump dotnet/sdk from 3063015 to bb32ba3 in /baseimages (#2697)
#2133
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: ci | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| inputs: | |
| plugins: | |
| description: "Plugins to build and publish (i.e. connect-go:latest, connect-go, grpc/java:v1.53.0)" | |
| default: '' | |
| type: string | |
| env: | |
| DOCKER_ORG: "ghcr.io/bufbuild" | |
| # Ref: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions | |
| permissions: | |
| actions: read | |
| contents: read | |
| packages: write | |
| concurrency: ci-${{ github.ref }} | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest-4-cores | |
| steps: | |
| - name: set PLUGINS from workflow inputs | |
| if: ${{ inputs.plugins }} | |
| run: echo "PLUGINS=${{ inputs.plugins }}" >> $GITHUB_ENV | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Go | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version-file: 'go.mod' | |
| check-latest: true | |
| - name: Calculate changed plugins and set PLUGINS env var from last successful commit push | |
| if: ${{ inputs.plugins == '' }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| REPOSITORY: ${{ github.repository }} | |
| REF_NAME: ${{ github.ref_name }} | |
| run: | | |
| base_ref=$(gh api "repos/${REPOSITORY}/actions/workflows/ci.yml/runs?branch=${REF_NAME}&status=success&per_page=1" --jq '.workflow_runs[0].head_sha') | |
| val=$(go run ./internal/cmd/changed-plugins --base-ref "${base_ref}") | |
| if [[ -n "${val}" && -z "${PLUGINS}" ]]; then | |
| echo "PLUGINS=${val}" >> $GITHUB_ENV | |
| fi | |
| - name: Get buf version | |
| shell: bash | |
| run: | | |
| echo BUF_VERSION=$(go list -m -f '{{.Version}}' github.com/bufbuild/buf | cut -c2-) >> $GITHUB_ENV | |
| - uses: bufbuild/buf-action@v1 | |
| with: | |
| setup_only: true | |
| - uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| id: buildx | |
| uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0 | |
| - name: Login to GitHub Container Registry | |
| if: github.repository == 'bufbuild/plugins' | |
| uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Test | |
| run: make test | |
| - name: Push to GHCR | |
| if: github.repository == 'bufbuild/plugins' | |
| run: make dockerpush |