Standalone #200
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
# Tencent is pleased to support the open source community by making Polaris available. | |
# | |
# Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. | |
# | |
# Licensed under the BSD 3-Clause License (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# https://opensource.org/licenses/BSD-3-Clause | |
# | |
# Unless required by applicable law or agreed to in writing, software distributed | |
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR | |
# CONDITIONS OF ANY KIND, either express or implied. See the License for the | |
# specific language governing permissions and limitations under the License. | |
name: Standalone | |
on: | |
workflow_dispatch: | |
inputs: | |
server_version: | |
description: "tag version for polaris" | |
required: true | |
console_version: | |
description: "tag version for polaris-console" | |
required: true | |
limiter_version: | |
description: "tag version for polaris-limiter" | |
required: true | |
jobs: | |
release: | |
name: Release polaris standalone | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
goos: [ linux, windows, darwin, kubernetes ] | |
goarch: [ amd64, arm64 ] | |
exclude: | |
- goos: windows | |
goarch: arm64 | |
- goos: kubernetes | |
goarch: arm64 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.inputs.server_version }} | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.20" | |
- name: Build | |
id: build | |
env: | |
GOOS: ${{ matrix.goos }} | |
GOARCH: ${{ matrix.goarch }} | |
SERVER_VERSION: ${{ github.event.inputs.server_version }} | |
CONSOLE_VERSION: ${{ github.event.inputs.console_version }} | |
LIMITER_VERSION: ${{ github.event.inputs.limiter_version }} | |
run: | | |
set -e | |
workdir=$(pwd) | |
cd ${workdir} | |
export WORKDIR=${workdir} | |
ls -lstrh | |
bash release/standalone/build_standalone.sh | |
- name: Get Release by Tag | |
id: get_release_by_tag | |
uses: jonfriesen/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.event.inputs.server_version }} | |
# - name: Upload asset | |
# uses: actions/upload-release-asset@v1 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# upload_url: ${{ steps.get_release_by_tag.outputs.upload_url }} | |
# asset_path: ./${{ steps.build.outputs.name }} | |
# asset_name: ${{ steps.build.outputs.name }} | |
# asset_content_type: application/gzip | |
- name: Upload | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SERVER_VERSION: ${{ github.event.inputs.server_version }} | |
run: | | |
hub release edit $(find . -type f -name "polaris-*.zip" -printf "-a %p ") -m "" "${SERVER_VERSION}" |