|
| 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