This is an automated email from the ASF dual-hosted git repository. liujun pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
The following commit(s) were added to refs/heads/main by this push: new 8c3057fbe Add protoc release action (#2516) 8c3057fbe is described below commit 8c3057fbeb5c99007301679e094a13e3b412ad8c Author: Ken Liu <ken.lj...@gmail.com> AuthorDate: Tue Nov 28 17:32:27 2023 +0800 Add protoc release action (#2516) --- .github/workflows/protoc-release.yml | 64 ++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/.github/workflows/protoc-release.yml b/.github/workflows/protoc-release.yml new file mode 100644 index 000000000..1b278fa88 --- /dev/null +++ b/.github/workflows/protoc-release.yml @@ -0,0 +1,64 @@ +name: Protoc-gen-go-triple Release + +on: + release: + types: [published] + +jobs: + release: + permissions: + contents: write + + name: Release cmd/protoc-gen-go-triple + runs-on: ubuntu-latest + if: startsWith(github.event.release.tag_name, 'cmd/protoc-gen-go-triple/') + strategy: + matrix: + goos: [linux, darwin, windows] + goarch: [386, amd64, arm64] + exclude: + - goos: darwin + goarch: 386 + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + + - name: Download dependencies + run: | + cd cmd/protoc-gen-go-triple + go mod download + + - name: Prepare build directory + run: | + mkdir -p build/ + cp README.md build/ + cp LICENSE build/ + + - name: Build + env: + GOOS: ${{ matrix.goos }} + GOARCH: ${{ matrix.goarch }} + run: | + cd cmd/protoc-gen-go-triple + go build -trimpath -o $GITHUB_WORKSPACE/build + + - name: Create package + id: package + run: | + PACKAGE_NAME=protoc-gen-go-triple.${GITHUB_REF#refs/tags/cmd/protoc-gen-go-triple/}.${{ matrix.goos }}.${{ matrix.goarch }}.tar.gz + tar -czvf $PACKAGE_NAME -C build . + echo "name=${PACKAGE_NAME}" >> $GITHUB_OUTPUT + + - name: Upload asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./${{ steps.package.outputs.name }} + asset_name: ${{ steps.package.outputs.name }} + asset_content_type: application/gzip