Skip to content

Commit

Permalink
draft for unified gh workflow (starting with java)
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzzimmer committed Sep 9, 2024
1 parent aa468a1 commit 83140cc
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/buf.yaml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 83140cc

Please sign in to comment.