Skip to content

Build and Publish CLI #1

Build and Publish CLI

Build and Publish CLI #1

Workflow file for this run

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