-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feature: protocol buffer 環境を作成しました * fix: ssh key の設定を行いました * fix: api/proto/pkg を作るようにしました * fix: protocol buffer のインストールスクリプトを修正 * fix: protocol buffer のインストールスクリプトを修正 * fix: protocol buffer のインストールスクリプトを修正 * fix: protocol buffer のインストールスクリプトを修正 * fix: protocol buffer のインストールスクリプトを修正 * fix: protocol buffer のインストールスクリプトを修正 * fix: protocol buffer のインストールスクリプトを修正 * fix: protocol buffer のインストールスクリプトを修正 * fix: protocol buffer のインストールスクリプトを修正 * fix: protocol buffer のインストールスクリプトを修正 * feature: protoc のバージョンを環境変数から指定できるようにした * fix: gen ディレクトリへの staticcheck のチェックをなくしました
- Loading branch information
1 parent
bf5e7ca
commit da82b8c
Showing
13 changed files
with
597 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: ci | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
protobuf-check: | ||
runs-on: ubuntu-latest | ||
env: | ||
PROTOBUF_VERSION: "25.0" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up SSH | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.SSH_SECRET_KEY }} | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21.2" | ||
|
||
# 参照 | ||
# https://grpc.io/docs/languages/go/quickstart/ | ||
- name: Install Protobuf | ||
run: | | ||
wget https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-x86_64.zip | ||
unzip protoc-$PROTOBUF_VERSION-linux-x86_64.zip -d protoc-$PROTOBUF_VERSION-linux-x86_64 | ||
sudo mv protoc-$PROTOBUF_VERSION-linux-x86_64/bin/protoc /usr/local/bin/protoc | ||
sudo mv protoc-$PROTOBUF_VERSION-linux-x86_64/include/* /usr/local/include/ | ||
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | ||
export PATH="$PATH:$(go env GOPATH)/bin" | ||
- name: Run protoc | ||
run: | | ||
make generate_proto | ||
- name: Check for changes | ||
id: git-check | ||
run: | | ||
git diff --exit-code api/gen | ||
continue-on-error: true | ||
|
||
- name: Fail if changes are detected | ||
if: steps.git-check.outcome == 'failure' | ||
run: | | ||
echo "Changes detected in api/gen directory!" | ||
exit 1 |
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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# for protobuf | ||
api/proto/pkg | ||
|
||
firebase-adminsdk-secret.json |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.PHONY: deploy-dev | ||
deploy-dev: | ||
git checkout dev | ||
git fetch origin | ||
git reset --hard origin/main | ||
git merge ${branch} | ||
git log -n 2 | ||
git push -f origin dev | ||
git checkout ${branch} | ||
|
||
.PHONY: generate_proto | ||
generate_proto: | ||
sh scripts/gen_proto.sh |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.