Files
gf/.github/workflows/release.yml
Copilot 6e0ba551f9 ci(release): disable go module caching in release workflow (#4539)
Resolves TODO comment requesting cache to be disabled for the
`actions/setup-go` step in the release workflow.

- Add `cache: false` to `actions/setup-go@v5` configuration
- Remove the now-completed TODO comment

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> 处理 TODO: 禁用缓存 (来自 .github/workflows/release.yml)


</details>

Created from VS Code via the [GitHub Pull
Request](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github)
extension.

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

---------

Co-authored-by: hailaz <739476267@qq.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: hailaz <29968474+hailaz@users.noreply.github.com>
2025-12-04 14:27:01 +08:00

67 lines
1.7 KiB
YAML

name: GoFrame Release
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
env:
TZ: Asia/Shanghai
jobs:
build:
name: Build And Release
runs-on: ubuntu-latest
steps:
- name: Checkout Github Code
uses: actions/checkout@v5
- name: Set Up Golang Environment
uses: actions/setup-go@v5
with:
go-version: 1.25
cache: false
- name: Build CLI Binary
run: |
echo "Building linux amd64 binary..."
cd cmd/gf
GOOS=linux GOARCH=amd64 go build main.go
chmod +x main
./main install -y
- name: Build CLI Binary For All Platform
run: |
cd cmd/gf
gf build main.go -n gf -a all -s linux,windows,darwin,freebsd,netbsd,openbsd -p temp
- name: Move Files Before Release
run: |
cd cmd/gf/temp
for OS in *;do for FILE in $OS/*;\
do if [[ ${OS} =~ 'windows' ]];\
then mv $FILE gf_$OS.exe && rm -rf $OS;\
else mv $FILE gf_$OS && rm -rf $OS;\
fi;done;done
- name: Create Github Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
name: GoFrame Release ${{ github.ref_name }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: alexellis/upload-assets@0.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["cmd/gf/temp/gf_*"]'