Skip to content

style(cli): improve status and sync log output #32

style(cli): improve status and sync log output

style(cli): improve status and sync log output #32

Workflow file for this run

name: release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
goos: [linux, darwin]
goarch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache-dependency-path: go.mod
- name: Build archives
run: |
set -euo pipefail
mkdir -p dist
BIN_NAME=yiduo
VERSION=${{ github.ref_name }}
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} CGO_ENABLED=0 \
go build -trimpath -ldflags "-s -w -X main.version=${VERSION}" -o "dist/${BIN_NAME}" .
tar -czf "dist/${BIN_NAME}_${{ matrix.goos }}_${{ matrix.goarch }}.tar.gz" -C dist "${BIN_NAME}"
rm -f "dist/${BIN_NAME}"
- name: Upload release archives
uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/*.tar.gz
if-no-files-found: error
release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist
- name: Upload release assets
uses: softprops/action-gh-release@v2
with:
files: |
dist/**/yiduo_*.tar.gz
fail_on_unmatched_files: true
tag_name: ${{ github.ref_name }}