Skip to content

Bump github.com/bufbuild/buf from 1.21.0 to 1.22.0 (#618) #467

Bump github.com/bufbuild/buf from 1.21.0 to 1.22.0 (#618)

Bump github.com/bufbuild/buf from 1.21.0 to 1.22.0 (#618) #467

Workflow file for this run

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
steps:
- name: set PLUGINS from workflow inputs
if: ${{ inputs.plugins }}
run: echo "PLUGINS=${{ inputs.plugins }}" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@177b48373c6dc583ce0d9257ffb484bdd232fedf
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@e1754a427f478b8778d349341b8f1d80f1f47f44
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@v4
with:
go-version: 1.20.x
check-latest: true
cache: 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: Install buf cli
uses: bufbuild/[email protected]
with:
github_token: ${{ github.token }}
- name: Set up QEMU
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34
- name: Login to Docker Hub
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
if: github.repository == 'bufbuild/plugins'
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
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