65 lines
2.0 KiB
YAML
65 lines
2.0 KiB
YAML
# This workflow will build a golang project
|
|
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
|
|
|
|
name: Gitee CLI Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
|
|
jobs:
|
|
create-release:
|
|
name: Create Release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Get Commits since last Release
|
|
id: changes
|
|
uses: simbo/changes-since-last-release-action@v1
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: Release ${{ github.ref }}
|
|
body: |
|
|
Release ${{ github.ref }}
|
|
---
|
|
Changes since ${{ steps.changes.outputs.last-tag }}:
|
|
${{ steps.changes.outputs.log }}
|
|
draft: false
|
|
prerelease: false
|
|
releases-matrix:
|
|
name: Release Go Binary
|
|
runs-on: ubuntu-latest
|
|
needs: create-release
|
|
strategy:
|
|
matrix:
|
|
# build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64
|
|
goos: [linux, windows, darwin]
|
|
goarch: ["386", amd64, arm64]
|
|
exclude:
|
|
- goarch: "386"
|
|
goos: darwin
|
|
- goarch: arm64
|
|
goos: windows
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: wangyoucao577/go-release-action@v1
|
|
with:
|
|
github_token: ${{ secrets.TOKEN }}
|
|
goos: ${{ matrix.goos }}
|
|
goarch: ${{ matrix.goarch }}
|
|
goversion: 1.19
|
|
binary_name: "gitee"
|
|
extra_files: LICENSE README.md
|