Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump API version and fix automatic bumping #136

Merged
merged 11 commits into from
Nov 4, 2024
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
version: 2
updates:
- package-ecosystem: 'bundler'
Expand Down
33 changes: 3 additions & 30 deletions .github/workflows/automatic-api-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,53 +16,26 @@ jobs:
with:
api-commit: "${{ github.event.client_payload.BUFTAG }}"
spec-path: buf.gen.yaml
file-format: generate-shell-script
file-format: "buf-gen-yaml"
- name: "Output update status"
env:
UPDATED_STATUS: ${{ steps.buf-update.outputs.updated }}
run: |
echo "Update status: $UPDATED_STATUS"
- name: "Install ruby and dependencies"
uses: "ruby/setup-ruby@v1"
with:
bundler-cache: true
- name: "Update package version"
uses: authzed/actions/semver-update@main
if: steps.buf-update.outputs.updated == 'true'
with:
sourcefile-path: authzed.gemspec
version-regex: 's.version = "(.+)"'
version-change: minor
- name: "Update Gemfile"
run: |
bundle config unset deployment
bundle install
- name: "Install protoc"
uses: "arduino/setup-protoc@v3"
with:
version: "24.4"
- name: "Install Homebrew & gRPC"
run: |
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/runner/.bash_profile
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install grpc
which grpc_ruby_plugin
echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH
- name: "Install buf"
uses: "bufbuild/[email protected]"
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
if: steps.buf-update.outputs.updated == 'true'
- name: "Run buf generate"
if: steps.buf-update.outputs.updated == 'true'
run: |
./buf.gen.yaml
run: "buf generate"
- name: Create Pull Request
uses: peter-evans/[email protected]
if: steps.buf-update.outputs.updated == 'true'
with:
delete-branch: "true"
title: "Update API to ${{ github.event.client_payload.BUFTAG }}"
branch: "api-change/${{ github.event.client_payload.BUFTAG }}"
base: "main"
token: ${{ secrets.GITHUB_TOKEN }}
34 changes: 4 additions & 30 deletions .github/workflows/manual-api-update.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Update for API change
on:
workflow_dispatch:
Expand All @@ -20,53 +21,26 @@ jobs:
with:
api-commit: ${{ inputs.buftag }}
spec-path: buf.gen.yaml
file-format: generate-shell-script
file-format: "buf-gen-yaml"
- name: "Output update status"
env:
UPDATED_STATUS: ${{ steps.buf-update.outputs.updated }}
run: |
echo "Update status: $UPDATED_STATUS"
- name: "Install ruby and dependencies"
uses: "ruby/setup-ruby@v1"
with:
bundler-cache: true
- name: "Update package version"
uses: authzed/actions/semver-update@main
if: steps.buf-update.outputs.updated == 'true'
with:
sourcefile-path: authzed.gemspec
version-regex: 's.version = "(.+)"'
version-change: minor
- name: "Update Gemfile"
run: |
bundle config unset deployment
bundle install
- name: "Install protoc"
uses: "arduino/setup-protoc@v3"
with:
version: "24.4"
- name: "Install Homebrew & gRPC"
run: |
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/runner/.bash_profile
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install grpc
which grpc_ruby_plugin
echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH
- name: "Install buf"
uses: "bufbuild/[email protected]"
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
if: steps.buf-update.outputs.updated == 'true'
- name: "Run buf generate"
if: steps.buf-update.outputs.updated == 'true'
run: |
./buf.gen.yaml
run: "buf generate"
- name: Create Pull Request
uses: peter-evans/[email protected]
if: steps.buf-update.outputs.updated == 'true'
with:
delete-branch: "true"
title: Update API to ${{ inputs.buftag }}
branch: api-change/${{ inputs.buftag }}
base: "main"
token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: "Publish gem to Rubygems"
on:
push:
Expand Down
12 changes: 6 additions & 6 deletions buf.gen.yaml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env -S buf generate --template
---
version: "v2"
plugins:
- protoc_builtin: "ruby"
out: "lib"
- local: "grpc_ruby_plugin"
out: "lib"
- remote: "buf.build/protocolbuffers/ruby:v28.3"
out: "lib"
- remote: "buf.build/grpc/ruby:v1.67.1"
out: "lib"
inputs:
- module: buf.build/authzed/api:v1.37.0
- module: "buf.build/authzed/api:v1.38.0"
2 changes: 1 addition & 1 deletion lib/authzed/api/v1/error_reason_pb.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/authzed/api/v1/permission_service_pb.rb

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion lib/authzed/api/v1/permission_service_services_pb.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion lib/authzed/api/v1/watch_service_pb.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading