Skip to content

Commit

Permalink
Merge pull request FloatTech#51 from fumiama/master
Browse files Browse the repository at this point in the history
✨ 更新编译
  • Loading branch information
fumiama committed Aug 6, 2021
2 parents b25cfc1 + 4abd380 commit 220483c
Show file tree
Hide file tree
Showing 7 changed files with 161 additions and 87 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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 arm64
run: CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GOARM=7 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-arm64
- 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: Upload Build Artifact
uses: actions/upload-artifact@v2
with:
name: zerobot-plugin-all.zip
path: ./artifacts/zerobot-plugin-*
42 changes: 0 additions & 42 deletions .github/workflows/linux.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint
name: PullLint
on: [pull_request]
jobs:
golangci:
Expand Down
File renamed without changes.
105 changes: 105 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
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 arm64
run: CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GOARM=7 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-arm64
- 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: 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 Linux x64
id: upload-release-asset-lx64
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/zerobot-plugin-linux-x64
asset_name: zerobot-plugin-linux-x64
asset_content_type: application/octet-stream
- name: Upload Release Asset Linux x86
id: upload-release-asset-lx86
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/zerobot-plugin-linux-x86
asset_name: zerobot-plugin-linux-x86
asset_content_type: application/octet-stream
- name: Upload Release Asset Windows x64
id: upload-release-asset-wx64
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/zerobot-plugin-windows-x64.exe
asset_name: zerobot-plugin-windows-x64.exe
asset_content_type: application/octet-stream
- name: Upload Release Asset Windows x86
id: upload-release-asset-wx86
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/zerobot-plugin-windows-x86.exe
asset_name: zerobot-plugin-windows-x86.exe
asset_content_type: application/octet-stream
- name: Upload Release Asset ARM64
id: upload-release-asset-arm64
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/zerobot-plugin-linux-arm64
asset_name: zerobot-plugin-linux-arm64
asset_content_type: application/octet-stream
- name: Upload Release Asset ARMv6
id: upload-release-asset-armv6
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/zerobot-plugin-linux-armv6
asset_name: zerobot-plugin-linux-armv6
asset_content_type: application/octet-stream

41 changes: 0 additions & 41 deletions .github/workflows/windows.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

</div>


Expand Down Expand Up @@ -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),本地解压
Expand Down

0 comments on commit 220483c

Please sign in to comment.