diff --git a/.github/workflows/buf.yaml b/.github/workflows/buf.yaml new file mode 100644 index 00000000..325836b6 --- /dev/null +++ b/.github/workflows/buf.yaml @@ -0,0 +1,55 @@ +name: buf + +on: + push: + tags: + - 'v*' + pull_request: + branches: + - main + +jobs: + java: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: action/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + + - uses: bufbuild/buf-action@v1 + with: + setup_only: true + github_token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.BUF_TOKEN }} + + - name: generate + run: make generate + + - name: test + working-directory: java + run: ./gradlew clean build + + - name: publish + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + working-directory: java + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + RELEASE_TAG=${GITHUB_REF/refs\/tags\/v/} + echo $RELEASE_TAG + ./gradlew -Pversion=$RELEASE_TAG clean publish + + buf: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: bufbuild/buf-action@v1 + with: + token: ${{ secrets.BUF_TOKEN }} + setup_only: false + github_token: ${{ secrets.GITHUB_TOKEN }} + breaking_against: "https://github.com/stroeer/tapir.git#branch=main"