Files
publish-go/README.md
T
2026-11-05 02:54:21 +00:00

30 lines
989 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# publish-go
上傳 `build-go` 打包的 zip 到 Gitea 的 Go 套件庫,成功才推送版本標籤;套件已存在(409)視為已上傳,接著推標籤,所以失敗後可以安全重跑。
## 用法
版本由呼叫端的 Gitea Actions 變數決定(例如 `vars.ACTION_PUBLISH_GO_VERSION`),不要用分支名稱:runner 依 ref 重用舊映像檔,改了腳本不會生效,所以每次改動都發新標籤。
```yaml
- uses: https://gitea.jsc.idv.tw/actions/publish-go@${{ vars.ACTION_PUBLISH_GO_VERSION }}
with:
version: ...
zip: ...
token: ...
```
## 輸入
|名稱|必填|預設|說明|
|---|---|---|---|
|`version`|是||要發佈的版本,要和 build-go 的相同|
|`zip`|是||build-go 輸出的模組 zip 路徑|
|`token`|是||推送標籤與上傳套件用的權杖(需要 write:repository、write:package)|
## 開發
`ci.yaml` 跑 shellcheck、、建置映像檔。
圖示:`icon.svg`(Gitea 儲存庫頭像用 `icon.png`)。