-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #223 from authzed/use-remote-plugins-and-bump-version
Use remote plugins for build
- Loading branch information
Showing
3 changed files
with
14 additions
and
86 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
--- | ||
name: "Called update for API change" | ||
on: | ||
repository_dispatch: | ||
types: ["api_update"] | ||
jobs: | ||
test: | ||
name: "Create PR for API update" | ||
timeout-minutes: 10 | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@v4" | ||
|
@@ -16,7 +16,7 @@ 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 }}" | ||
|
@@ -27,50 +27,15 @@ jobs: | |
with: | ||
github_token: "${{ secrets.GITHUB_TOKEN }}" | ||
if: "steps.buf-update.outputs.updated == 'true'" | ||
- name: "Install Python" | ||
uses: "actions/setup-python@v5" | ||
if: "steps.buf-update.outputs.updated == 'true'" | ||
with: | ||
python-version: "3.10" | ||
- name: "Setup Python Environment" | ||
if: "steps.buf-update.outputs.updated == 'true'" | ||
run: "pip install -U pip virtualenv" | ||
- name: "Install Homebrew & gRPC" | ||
if: "steps.buf-update.outputs.updated == 'true'" | ||
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)" | ||
echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH | ||
brew install grpc | ||
ls /home/linuxbrew/.linuxbrew/bin | ||
- name: "Install Python Dependencies" | ||
if: "steps.buf-update.outputs.updated == 'true'" | ||
run: | | ||
virtualenv ~/.cache/virtualenv/authzedpy | ||
source ~/.cache/virtualenv/authzedpy/bin/activate | ||
pip install poetry | ||
poetry env info | ||
poetry install | ||
echo "/home/runner/.cache/virtualenv/authzedpy/bin" >> $GITHUB_PATH | ||
python -V | ||
whereis grpc_python_plugin | ||
whereis protoc-gen-mypy | ||
whereis protoc-gen-mypy_grpc | ||
echo $GITHUB_PATH | ||
- name: "Run buf generate" | ||
if: "steps.buf-update.outputs.updated == 'true'" | ||
run: | | ||
./buf.gen.yaml | ||
- name: "Run poetry lock" | ||
if: "steps.buf-update.outputs.updated == 'true'" | ||
run: | | ||
poetry lock | ||
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 }}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--- | ||
name: "Update for API change" | ||
on: | ||
workflow_dispatch: | ||
|
@@ -9,7 +10,6 @@ on: | |
jobs: | ||
test: | ||
name: "Create PR for API update" | ||
timeout-minutes: 10 | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@v4" | ||
|
@@ -20,7 +20,7 @@ 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 }}" | ||
|
@@ -31,50 +31,15 @@ jobs: | |
with: | ||
github_token: "${{ secrets.GITHUB_TOKEN }}" | ||
if: "steps.buf-update.outputs.updated == 'true'" | ||
- name: "Install Python" | ||
uses: "actions/setup-python@v5" | ||
if: "steps.buf-update.outputs.updated == 'true'" | ||
with: | ||
python-version: "3.10" | ||
- name: "Setup Python Environment" | ||
if: "steps.buf-update.outputs.updated == 'true'" | ||
run: "pip install -U pip virtualenv" | ||
- name: "Install Homebrew & gRPC" | ||
if: "steps.buf-update.outputs.updated == 'true'" | ||
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)" | ||
echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH | ||
brew install grpc | ||
ls /home/linuxbrew/.linuxbrew/bin | ||
- name: "Install Python Dependencies" | ||
if: "steps.buf-update.outputs.updated == 'true'" | ||
run: | | ||
virtualenv ~/.cache/virtualenv/authzedpy | ||
source ~/.cache/virtualenv/authzedpy/bin/activate | ||
pip install poetry | ||
poetry env info | ||
poetry install | ||
echo "/home/runner/.cache/virtualenv/authzedpy/bin" >> $GITHUB_PATH | ||
python -V | ||
whereis grpc_python_plugin | ||
whereis protoc-gen-mypy | ||
whereis protoc-gen-mypy_grpc | ||
echo $GITHUB_PATH | ||
- name: "Run buf generate" | ||
if: "steps.buf-update.outputs.updated == 'true'" | ||
run: | | ||
./buf.gen.yaml | ||
- name: "Run poetry lock" | ||
if: "steps.buf-update.outputs.updated == 'true'" | ||
run: | | ||
poetry lock | ||
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 }}" | ||
base: "main" | ||
branch: "api-change/${{ inputs.buftag }}" | ||
token: "${{ secrets.GITHUB_TOKEN }}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
#!/usr/bin/env -S buf generate buf.build/authzed/api:v1.38.0 --template | ||
--- | ||
version: "v1" | ||
version: "v2" | ||
plugins: | ||
- name: "python" | ||
- remote: "buf.build/protocolbuffers/python:v28.3" | ||
out: "." | ||
- name: "grpc-python" | ||
- remote: "buf.build/grpc/python:v1.67.1" | ||
out: "." | ||
path: "grpc_python_plugin" | ||
- name: "mypy" | ||
out: "." | ||
- name: "mypy_grpc" | ||
- remote: "buf.build/community/nipunn1313-mypy:v3.6.0" | ||
out: "." | ||
inputs: | ||
- module: "buf.build/authzed/api:v1.38.0" |