Skip to content

Commit 7bbac15

Browse files
authored
feat: add a github action to setup swctl (#223)
1 parent 5eaa840 commit 7bbac15

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ VERSION ?= dev-$(shell git rev-parse --short HEAD)
1919
APP_NAME = skywalking-cli
2020
OUT_DIR = bin
2121
BINARY = swctl
22+
DESTDIR ?= /usr/local/bin
2223

2324
HUB ?= docker.io/apache
2425

actions/setup/action.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
inputs:
19+
install-dir:
20+
description: The directory to install swctl
21+
required: false
22+
default: /usr/local/bin
23+
version:
24+
description: The version of swctl to install
25+
required: false
26+
default: ""
27+
28+
name: Setup swctl
29+
description: Setup swctl
30+
branding:
31+
icon: book
32+
color: orange
33+
runs:
34+
using: "composite"
35+
steps:
36+
- name: Set up Go
37+
uses: actions/setup-go@v5
38+
with:
39+
go-version: 1.24
40+
cache-dependency-path: ${{ github.action_path }}/go.sum
41+
- name: Checkout
42+
if: inputs.version != ''
43+
uses: actions/checkout@v4
44+
with:
45+
repository: apache/skywalking-cli
46+
ref: ${{ inputs.version }}
47+
path: skywalking-cli-${{ inputs.version }}
48+
- if: inputs.version == ''
49+
shell: bash -euxo pipefail {0}
50+
run: |
51+
sudo make -C ${GITHUB_ACTION_PATH}/../.. DESTDIR=${{ inputs.install-dir }} install
52+
swctl --version
53+
- if: inputs.version != ''
54+
shell: bash -euxo pipefail {0}
55+
run: |
56+
sudo make -C ${GITHUB_WORKSPACE}/skywalking-cli-${{ inputs.version }} DESTDIR=${{ inputs.install-dir }} install
57+
swctl --version

0 commit comments

Comments
 (0)