This is an automated email from the ASF dual-hosted git repository. kezhenxu94 pushed a commit to branch action in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git
commit 652524b9b635a4c2a79894f3c4aaa644006a9757 Author: kezhenxu94 <kezhenx...@apache.org> AuthorDate: Tue May 20 10:58:52 2025 +0800 feat: add a github action to setup swctl --- Makefile | 1 + actions/setup/action.yaml | 52 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/Makefile b/Makefile index 6c036b0..09d9725 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,7 @@ VERSION ?= dev-$(shell git rev-parse --short HEAD) APP_NAME = skywalking-cli OUT_DIR = bin BINARY = swctl +DESTDIR ?= /usr/local/bin HUB ?= docker.io/apache diff --git a/actions/setup/action.yaml b/actions/setup/action.yaml new file mode 100644 index 0000000..7d2017b --- /dev/null +++ b/actions/setup/action.yaml @@ -0,0 +1,52 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# 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. + +inputs: + install-dir: + description: The directory to install swctl + required: false + default: /usr/local/bin + version: + description: The version of swctl to install + required: false + default: '' + +name: Setup swctl +description: Setup swctl +branding: + icon: book + color: orange +runs: + using: "composite" + steps: + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.24 + cache-dependency-path: ${{ github.action_path }}/go.sum + - name: Checkout + if: inputs.version != '' + uses: actions/checkout@v4 + with: + ref: ${{ inputs.version }} + path: ${GITHUB_ACTION_PATH}/../${{ inputs.version }} + - if: inputs.version == '' + shell: bash -euxo pipefail {0} + run: sudo make -C ${GITHUB_ACTION_PATH}/../.. DESTDIR=${{ inputs.install-dir }} install + - if: inputs.version != '' + shell: bash -euxo pipefail {0} + run: sudo make -C ${GITHUB_ACTION_PATH}/../${{ inputs.version }} DESTDIR=${{ inputs.install-dir }} install \ No newline at end of file