Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
soxft committed Sep 20, 2024
1 parent 603f98f commit 15182f5
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: build release

on:
push:
tags:
- "v*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21

- name: Build
run: |
GOOS=linux GOARCH=amd64 go build -o busuanzi-sync-linux-amd64-${{ github.ref_name }}
GOOS=linux GOARCH=arm64 go build -o busuanzi-sync-linux-arm64-${{ github.ref_name }}
GOOS=darwin GOARCH=amd64 go build -o busuanzi-sync-darwin-amd64-${{ github.ref_name }}
GOOS=darwin GOARCH=arm64 go build -o busuanzi-sync-darwin-arm64-${{ github.ref_name }}
GOOS=windows GOARCH=amd64 go build -o busuanzi-sync-windows-amd64-${{ github.ref_name }}.exe
GOOS=windows GOARCH=arm64 go build -o busuanzi-sync-windows-arm64-${{ github.ref_name }}.exe
GOOS=windows GOARCH=386 go build -o busuanzi-sync-windows-386-${{ github.ref_name }}.exe
- name: Archive
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
busuanzi-sync-linux-amd64-${{ github.ref_name }}
busuanzi-sync-linux-arm64-${{ github.ref_name }}
busuanzi-sync-darwin-amd64-${{ github.ref_name }}
busuanzi-sync-darwin-arm64-${{ github.ref_name }}
busuanzi-sync-windows-amd64-${{ github.ref_name }}.exe
busuanzi-sync-windows-arm64-${{ github.ref_name }}.exe
busuanzi-sync-windows-386-${{ github.ref_name }}.exe
token: ${{ secrets.GITHUB_TOKEN }}
release_name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
body: ${{ github.event.release.body }}
draft: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

## 使用方法

1. 按照提示填写 .env 文件
1. 按照提示填写 .env.exmaple 文件 并重命名为 .env
2. 运行脚本 `go build && ./busuanzi-sync`


Expand Down

0 comments on commit 15182f5

Please sign in to comment.