...

Text file src/google.golang.org/grpc/.github/workflows/release.yml

Documentation: google.golang.org/grpc/.github/workflows

     1name: Release
     2
     3on:
     4  release:
     5    types: [published]
     6
     7permissions:
     8  contents: read
     9
    10jobs:
    11  release:
    12    permissions:
    13      contents: write # to upload release asset (actions/upload-release-asset)
    14
    15    name: Release cmd/protoc-gen-go-grpc
    16    runs-on: ubuntu-latest
    17    if: startsWith(github.event.release.tag_name, 'cmd/protoc-gen-go-grpc/')
    18    strategy:
    19      matrix:
    20        goos: [linux, darwin, windows]
    21        goarch: [386, amd64, arm64]
    22        exclude:
    23          - goos: darwin
    24            goarch: 386
    25
    26    steps:
    27      - name: Checkout code
    28        uses: actions/checkout@v4
    29
    30      - name: Set up Go
    31        uses: actions/setup-go@v5
    32
    33      - name: Download dependencies
    34        run: |
    35          cd cmd/protoc-gen-go-grpc
    36          go mod download
    37
    38      - name: Prepare build directory
    39        run: |
    40          mkdir -p build/
    41          cp README.md build/
    42          cp LICENSE build/
    43
    44      - name: Build
    45        env:
    46          GOOS: ${{ matrix.goos }}
    47          GOARCH: ${{ matrix.goarch }}
    48        run: |
    49          cd cmd/protoc-gen-go-grpc
    50          go build -trimpath -o $GITHUB_WORKSPACE/build
    51
    52      - name: Create package
    53        id: package
    54        run: |
    55          PACKAGE_NAME=protoc-gen-go-grpc.${GITHUB_REF#refs/tags/cmd/protoc-gen-go-grpc/}.${{ matrix.goos }}.${{ matrix.goarch }}.tar.gz
    56          tar -czvf $PACKAGE_NAME -C build .
    57          echo "name=${PACKAGE_NAME}" >> $GITHUB_OUTPUT
    58
    59      - name: Upload asset
    60        uses: actions/upload-release-asset@v1
    61        env:
    62          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    63        with:
    64          upload_url: ${{ github.event.release.upload_url }}
    65          asset_path: ./${{ steps.package.outputs.name }}
    66          asset_name: ${{ steps.package.outputs.name }}
    67          asset_content_type: application/gzip

View as plain text