add README documentation for Fog Model and Protocol Buffer schemas #1
No files matched your search
@@ -17,7 +17,7 @@ jobs:
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.ref }}
|
||||
ref: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.head.sha || github.sha }}
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v7
|
||||
@@ -26,21 +26,37 @@ jobs:
|
||||
|
||||
- name: Install protoc
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y protobuf-compiler
|
||||
curl --fail --location --silent --show-error \
|
||||
--output "$RUNNER_TEMP/protoc.zip" \
|
||||
https://github.com/protocolbuffers/protobuf/releases/download/v36.2/protoc-36.2-linux-x86_64.zip
|
||||
unzip -q "$RUNNER_TEMP/protoc.zip" -d "$RUNNER_TEMP/protoc"
|
||||
echo "$RUNNER_TEMP/protoc/bin" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Install protoc-gen-go
|
||||
run: |
|
||||
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
||||
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.12
|
||||
|
||||
- name: Generate Protobufs
|
||||
run: |
|
||||
make proto
|
||||
|
||||
- name: Commit and push changes
|
||||
env:
|
||||
HEAD_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
HEAD_REF: ${{ github.event.pull_request.head.ref }}
|
||||
REPOSITORY: ${{ github.repository }}
|
||||
run: |
|
||||
git config --global user.name "actions[bot]"
|
||||
git config --global user.email "noreply@beejay.kim"
|
||||
git add .
|
||||
git commit -m "Update generated Protobufs" || echo "No changes to commit"
|
||||
git push origin ${{ github.ref }} || echo "No changes to push"
|
||||
git add -- '*.pb.go'
|
||||
if git diff --cached --quiet; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$HEAD_REPOSITORY" != "$REPOSITORY" ]; then
|
||||
echo "::error::Generated protobufs are out of date. Run make proto and commit the changes."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git config user.name "actions[bot]"
|
||||
git config user.email "noreply@beejay.kim"
|
||||
git commit -m "Update generated Protobufs"
|
||||
git push origin "HEAD:refs/heads/$HEAD_REF"
|
||||
@@ -55,13 +55,17 @@ The module requires Go 1.27 and `google.golang.org/protobuf`.
|
||||
|
||||
## Regenerating Go code
|
||||
|
||||
Install `protoc` and the Go generator, and ensure both executables are on
|
||||
`PATH`:
|
||||
Install `protoc` 36.2 using the [official installation
|
||||
instructions](https://protobuf.dev/installation/), and ensure it and the Go
|
||||
generator are on `PATH`:
|
||||
|
||||
```sh
|
||||
protoc --version
|
||||
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.12
|
||||
make proto
|
||||
```
|
||||
|
||||
`make proto` regenerates the Go files from both schemas. Commit the updated
|
||||
`.pb.go` files together with any schema changes.
|
||||
`.pb.go` files together with any schema changes. The workflow pushes generated
|
||||
files to same-repository pull request branches; for pull requests from forks,
|
||||
it reports an error if generated files are out of date.
|
||||
@@ -6,7 +6,6 @@ option go_package = "beejay.kim/fog/model";
|
||||
enum DeploymentAction {
|
||||
STOP = 0;
|
||||
START = 1;
|
||||
CLEANUP = 2;
|
||||
}
|
||||
|
||||
message GlobalEnvironment {
|
||||
|
||||
Reference in new issue
Block a user