diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml deleted file mode 100644 index 950bd00d..00000000 --- a/.github/workflows/linux.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Compile ZeroBot-Plugin-linux -on: - push: - branches: - - master - -env: - GITHUB_TOKEN: ${{ github.token }} - -jobs: - my-job: - name: Build ZeroBot-Plugin-linux 🚀 - runs-on: ubuntu-latest - steps: - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.16 - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Cache Go - id: cache - uses: actions/cache@v2 - with: - # A list of files, directories, and wildcard patterns to cache and restore - path: ~/go/pkg/mod - key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }} - - - name: Tidy Go modules - run: go mod tidy - - - name: Build - run: go build -ldflags="-s -w" -o artifacts/ZeroBot-Plugin-linux - - - name: Upload Build Artifact - uses: actions/upload-artifact@v2 - with: - name: ZeroBot-Plugin-linux - path: ./artifacts diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 00000000..1e255556 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,54 @@ +name: 最新版 +on: + push: + branches: + - master + +env: + GITHUB_TOKEN: ${{ github.token }} + +jobs: + my-job: + name: Build ZeroBot-Plugin on Push 🚀 + runs-on: ubuntu-latest + steps: + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Cache Go + id: cache + uses: actions/cache@v2 + with: + # A list of files, directories, and wildcard patterns to cache and restore + path: ~/go/pkg/mod + key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }} + + - name: Tidy Go modules + run: go mod tidy + + - name: Build linux-x64 + run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-x64 + - name: Build linux-x86 + run: CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-x86 + - name: Build windows-x64 + run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-windows-x64.exe + - name: Build windows-x86 + run: CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-windows-x86.exe + - name: Build armv7 + run: CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-armv6 + - name: Build armv6 + run: CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-armv6 + - name: Build mips + run: GOOS=linux GOARCH=mips GOMIPS=softfloat CGO_ENABLED=0 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-mips + + - name: Upload Build Artifact + uses: actions/upload-artifact@v2 + with: + name: zerobot-plugin-* + path: ./artifacts diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..e2de2135 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,66 @@ +name: 稳定版 +on: + push: + tags: + - v* + +env: + GITHUB_TOKEN: ${{ github.token }} + +jobs: + my-job: + name: Build ZeroBot-Plugin on Push Tag 🚀 + runs-on: ubuntu-latest + steps: + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Cache Go + id: cache + uses: actions/cache@v2 + with: + # A list of files, directories, and wildcard patterns to cache and restore + path: ~/go/pkg/mod + key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }} + + - name: Tidy Go modules + run: go mod tidy + + - name: Build linux-x64 + run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-x64 + - name: Build linux-x86 + run: CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-x86 + - name: Build windows-x64 + run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-windows-x64.exe + - name: Build windows-x86 + run: CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-windows-x86.exe + - name: Build armv7 + run: CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-armv6 + - name: Build armv6 + run: CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-armv6 + - name: Build mips + run: GOOS=linux GOARCH=mips GOMIPS=softfloat CGO_ENABLED=0 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-mips + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./artifacts + asset_name: zerobot-plugin-* + asset_content_type: application/octet-stream \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index 14d17f28..00000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Compile ZeroBot-Plugin-windows -on: - push: - branches: - - master - -env: - GITHUB_TOKEN: ${{ github.token }} - -jobs: - my-job: - name: Build ZeroBot-Plugin-windows 🚀 - runs-on: windows-latest - steps: - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.16 - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Cache Go - id: cache - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }} - - - name: Tidy Go modules - run: go mod tidy - - - name: Build - run: go build -ldflags="-s -w" -o artifacts/ZeroBot-Plugin-windows.exe - - - name: Upload Build Artifact - uses: actions/upload-artifact@v2 - with: - name: ZeroBot-Plugin-windows.exe - path: ./artifacts diff --git a/README.md b/README.md index d20cf5d7..579c2c73 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,6 @@ [![License](https://img.shields.io/github/license/Yiwen-Chan/OneBot-YaYa.svg?style=flat-square&logo=gnu)](https://raw.githubusercontent.com/FloatTech/ZeroBot-Plugin/master/LICENSE) [![qq group](https://img.shields.io/badge/group-1048452984-red?style=flat-square&logo=tencent-qq)](https://jq.qq.com/?_wv=1027&k=QMb7x1mM) -[![Compile ZeroBot-Plugin-linux](https://github.com/FloatTech/ZeroBot-Plugin/actions/workflows/linux.yml/badge.svg?branch=master)](https://github.com/FloatTech/ZeroBot-Plugin/actions/workflows/linux.yml) -[![Compile ZeroBot-Plugin-windows](https://github.com/FloatTech/ZeroBot-Plugin/actions/workflows/windows.yml/badge.svg?branch=master)](https://github.com/FloatTech/ZeroBot-Plugin/actions/workflows/windows.yml) - @@ -117,6 +114,9 @@ | [yyuueexxiinngg/cqhttp-mirai](https://github.com/yyuueexxiinngg/cqhttp-mirai) | [Mirai](https://github.com/mamoe/mirai) | yyuueexxiinngg | | | [takayama-lily/onebot](https://github.com/takayama-lily/onebot) | [OICQ](https://github.com/takayama-lily/oicq) | takayama | | +### 使用稳定版 +可以前往[Release](https://github.com/FloatTech/ZeroBot-Plugin/releases)页面下载对应系统的稳定版,默认开启全部插件。 + ### 本地运行 1. 下载安装 [Go](https://studygolang.com/dl/golang/go1.16.2.windows-amd64.msi) 环境 2. 下载本项目[压缩包](https://github.com/Yiwen-Chan/ZeroBot-Plugin/archive/master.zip),本地解压