Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
193 additions
and
25 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,14 @@ | ||
name: buf-push | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
jobs: | ||
push-changes: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: bufbuild/buf-setup-action@v0.3.1 | ||
- uses: bufbuild/buf-push-action@v0.3.0 | ||
with: | ||
buf_token: ${{ secrets.BUF_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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: generate-prtos | ||
on: | ||
push: | ||
paths: | ||
- 'encodingapis/**/*.*' | ||
- '*.proto' | ||
jobs: | ||
generate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: bufbuild/buf-setup-action@v0.3.1 | ||
- | ||
name: Buf generate | ||
if: success() | ||
run: | | ||
buf generate | ||
- | ||
name: Set up Git | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config user.name GitHub | ||
git config user.email noreply@github.com | ||
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | ||
- | ||
name: Commit and push changes | ||
run: | | ||
git add . | ||
if output=$(git status --porcelain) && [ ! -z "$output" ]; then | ||
git commit --author "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" --message "buf generate" | ||
git push | ||
fi |
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,45 @@ | ||
name: goreleaser | ||
|
||
on: | ||
pull_request: | ||
push: | ||
tags: | ||
- '*' | ||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
- | ||
name: Docker Login | ||
if: success() && startsWith(github.ref, 'refs/tags/v') | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | ||
run: | | ||
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin | ||
echo "${GITHUB_TOKEN}" | docker login ghcr.io --username $GITHUB_ACTOR --password-stdin | ||
echo "${BUF_TOKEN}" | docker login plugins.buf.build --username "${BUF_USERNAME}" --password-stdin | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- | ||
name: Clear | ||
if: always() && startsWith(github.ref, 'refs/tags/v') | ||
run: | | ||
rm -f ${HOME}/.docker/config.json |
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,22 @@ | ||
on: [push, pull_request] | ||
name: Test | ||
jobs: | ||
Build: | ||
strategy: | ||
matrix: | ||
go-version: [1.17.x] | ||
platform: [ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Fetch Repository | ||
uses: actions/checkout@v2 | ||
- name: Setup modules | ||
run: | | ||
go mod tidy | ||
- name: Run Test | ||
run: | | ||
go test -race |
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 |
---|---|---|
@@ -1 +1,50 @@ | ||
# protoc-gen-go-ras | ||
# protoc-gen-go-ras | ||
|
||
[![Release](https://img.shields.io/github/release/v8platform/protoc-gen-go-ras.svg?style=for-the-badge)](https://github.com/v8platform/protoc-gen-go-ras/releases/latest) | ||
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=for-the-badge)](/LICENSE.md) | ||
[![Build status](https://img.shields.io/github/workflow/status/v8platform/protoc-gen-go-ras/goreleaser?style=for-the-badge)](https://github.com/v8platform/protoc-gen-go-ras/actions?workflow=goreleaser) | ||
[![Codecov branch](https://img.shields.io/codecov/c/github/v8platform/protoc-gen-go-ras/master.svg?style=for-the-badge)](https://codecov.io/gh/v8platform/protoc-gen-go-ras) | ||
[![Go Doc](https://img.shields.io/badge/godoc-reference-blue.svg?style=for-the-badge)](http://godoc.org/github.com/v8platform/protoc-gen-go-ras) | ||
[![SayThanks.io](https://img.shields.io/badge/SayThanks.io-%E2%98%BC-1EAEDB.svg?style=for-the-badge)](https://saythanks.io/to/khorevaa) | ||
[![Powered By: GoReleaser](https://img.shields.io/badge/powered%20by-goreleaser-green.svg?style=for-the-badge)](https://github.com/goreleaser) | ||
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=for-the-badge)](https://conventionalcommits.org) | ||
|
||
## Описание | ||
|
||
Это плагин для `protoc` и требует его установки | ||
|
||
Обеспечивает генерация методов и различных помощников для RAS | ||
|
||
Создает следующие методы для `proto` файлов | ||
|
||
```go | ||
func (m *message) Parse(r io.Reader, veriosn int32) err { | ||
// Сгенерированный код | ||
} | ||
|
||
func (m *message) Formatter(w io.Writer, veriosn int32) err { | ||
// Сгенерированный код | ||
} | ||
``` | ||
|
||
|
||
## Как установить | ||
|
||
* Установить из [`releases`](https://github.com/v8platform/protoc-gen-go-ras/releases/) | ||
* Использовать готовый образ `docker` | ||
* `docker pull v8platform/protoc-gen-go-ras:latest` | ||
* `docker pull ghcr.io/v8platform/protoc-gen-go-ras:latest` | ||
* Сборка для через `go get` | ||
```shell | ||
go get github.com/v8platform/protoc-gen-go-ras/... | ||
go install github.com/v8platform/protoc-gen-go-ras | ||
``` | ||
|
||
### Описание возможностей | ||
|
||
TODO | ||
|
||
|
||
## License | ||
|
||
Лицензия [`LICENSE`](LICENSE) |
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
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,10 @@ | ||
# Generated by buf. DO NOT EDIT. | ||
version: v1 | ||
deps: | ||
- remote: buf.build | ||
owner: v8platform | ||
repository: encodingapis | ||
branch: main | ||
commit: ed9a75c1223f43759e3c7be9067aa8ac | ||
digest: b1-kAStsQhzYGPt2Wk8ZNCl6KYUNoKQS1JwwwgpEXLPyZs= | ||
create_time: 2021-09-02T12:20:10.287435Z |