update workflow #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go Build and Publish Release | |
on: | |
workflow_dispatch: | |
inputs: | |
tags: | |
description: "Version tags" | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: [1.21.6] # You can specify the Go version you need here | |
platform: [linux/amd64, linux/arm64] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Build Go project | |
run: | | |
export GOARCH=$(echo ${{ matrix.platform }} | cut -d '/' -f 2) | |
export GOOS=$(echo ${{ matrix.platform }} | cut -d '/' -f 1) | |
go build -o psutil-$GOOS-$GOARCH.so | |
ls -lart | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: psutil-linux-plugin | |
files: | | |
*.so | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get Release URL | |
run: | | |
echo "Release URL: ${{ steps.create_release.outputs.upload_url }}" |