github.com/polarismesh/polaris@v1.17.8/.github/workflows/release.yml (about)

     1  # Tencent is pleased to support the open source community by making Polaris available.
     2  #
     3  # Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
     4  #
     5  # Licensed under the BSD 3-Clause License (the "License");
     6  # you may not use this file except in compliance with the License.
     7  # You may obtain a copy of the License at
     8  #
     9  # https://opensource.org/licenses/BSD-3-Clause
    10  #
    11  # Unless required by applicable law or agreed to in writing, software distributed
    12  # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
    13  # CONDITIONS OF ANY KIND, either express or implied. See the License for the
    14  # specific language governing permissions and limitations under the License.
    15  
    16  name: Release
    17  
    18  on:
    19    release:
    20      types: [ published ]
    21  
    22  jobs:
    23    release:
    24      name: Release polaris
    25      runs-on: ubuntu-latest
    26      strategy:
    27        matrix:
    28          goos: [ linux, windows, darwin ]
    29          goarch: [ amd64, arm64 ]
    30          exclude:
    31            - goos: windows
    32              goarch: arm64
    33  
    34      steps:
    35        - name: Checkout code
    36          uses: actions/checkout@v2
    37  
    38        - name: Setup Go
    39          uses: actions/setup-go@v4
    40          with:
    41            go-version: "1.20"
    42  
    43        - name: Get version
    44          id: get_version
    45          run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
    46  
    47        - name: Build
    48          id: build
    49          env:
    50            GOOS: ${{ matrix.goos }}
    51            GOARCH: ${{ matrix.goarch }}
    52            VERSION: ${{ steps.get_version.outputs.VERSION }}
    53          run: |
    54            make build VERSION=${VERSION} ARCH=${GOARCH}
    55            PACKAGE_NAME=$(ls | grep polaris-server-release*.zip | sed -n '1p')
    56            echo ::set-output name=name::${PACKAGE_NAME}
    57  
    58        - name: Upload asset
    59          uses: softprops/action-gh-release@v0.1.15
    60          env:
    61            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    62          with:
    63            files: ./${{ steps.build.outputs.name }}
    64            name: ${{ steps.get_version.outputs.VERSION }}