Bump dotnet/sdk from a617978
to 483d6f3
in /.github/docker (#1728)
#1331
This file contains 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@v4 | |
with: | |
fetch-depth: 0 | |
- uses: nrwl/nx-set-shas@e2e6dc8bce4b0387a05eb687735c39c41580b792 | |
id: last_successful_commit_push | |
if: ${{ inputs.plugins == '' }} | |
with: | |
main-branch-name: ${{ github.ref_name }} | |
workflow-id: 'ci.yml' | |
- name: Get changed files | |
id: changed-files | |
if: ${{ inputs.plugins == '' }} | |
uses: tj-actions/changed-files@dcc7a0cba800f454d79fff4b993e8c3555bcc0a8 | |
with: | |
base_sha: ${{ steps.last_successful_commit_push.outputs.base }} | |
files: | | |
plugins/** | |
files_ignore: | | |
**/source.yaml | |
separator: "," | |
- name: Show changed files | |
if: ${{ inputs.plugins == '' }} | |
run: | | |
echo '${{ toJSON(steps.changed-files.outputs) }}' | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23' | |
check-latest: true | |
- name: Set PLUGINS env var from changed files | |
if: ${{ inputs.plugins == '' }} | |
env: | |
ALL_MODIFIED_FILES: ${{ steps.changed-files.outputs.all_modified_files }} | |
ANY_MODIFIED: ${{ steps.changed-files.outputs.any_modified }} | |
run: | | |
val=`go run ./internal/cmd/changed-plugins .` | |
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 -json github.com/bufbuild/buf | jq -r .Version) >> $GITHUB_ENV | |
- name: Install buf cli | |
run: | | |
go install github.com/bufbuild/buf/cmd/buf@${BUF_VERSION} | |
- name: Login to Docker Hub | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca | |
- name: Login to GitHub Container Registry | |
if: github.repository == 'bufbuild/plugins' | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 | |
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 |