-
Notifications
You must be signed in to change notification settings - Fork 10
43 lines (36 loc) · 1.17 KB
/
publish-cli.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Build and Publish CLI
on:
release:
types: [published]
concurrency:
group: publish-cli-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.platform == 'linux/arm64' && 'arm64_runner' || 'ubuntu-latest' }}
if: github.repository == 'langgenius/dify-plugin-daemon'
strategy:
matrix:
include:
- platform: linux/amd64
- platform: linux/arm64
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Transform platform
run: |
PLATFORM_TRANSFORMED=$(echo "${{ matrix.platform }}" | tr '/' '-')
echo "PLATFORM_TRANSFORMED=$PLATFORM_TRANSFORMED" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22.x
- name: Build CLI
run: |
go mod tidy
go build -o dify-plugin-${{ env.PLATFORM_TRANSFORMED }} ./cmd/commandline
- name: Publish CLI
run: |
gh release upload ${{ github.event.release.tag_name }} dify-plugin-${{ env.PLATFORM_TRANSFORMED }} --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}