Skip to content

fix:修改工作流文件5 #6

fix:修改工作流文件5

fix:修改工作流文件5 #6

Workflow file for this run

name: Release Coss Cli
on:
push:
tags:
- 'v*.*.*' # 只在 tag push 时触发工作流
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22
- name: Install GitHub CLI
run: |
type -p curl >/dev/null || sudo apt install curl -y
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh -y
- name: Print ref name
run: echo "The ref name is ${{ github.ref_name }}"
- name: Build and Release
env:
GO: go
VERSION: ${{ github.ref_name }}
TAG: ${{ github.ref_name }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make release VERSION=${{ github.ref_name }} TAG=${{ github.ref_name }}