mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 13:59:39 +08:00
✨ 更新编译
This commit is contained in:
parent
2900b4b616
commit
93ee86520b
52
.github/workflows/latest.yml
vendored
Normal file
52
.github/workflows/latest.yml
vendored
Normal file
@ -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
|
||||||
|
path: ./artifacts
|
||||||
65
.github/workflows/push.yml
vendored
65
.github/workflows/push.yml
vendored
@ -1,52 +1,31 @@
|
|||||||
name: 最新版
|
name: PushLint
|
||||||
on:
|
on: [push]
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
my-job:
|
golangci:
|
||||||
name: Build ZeroBot-Plugin on Push 🚀
|
name: lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
- name: Set up Go
|
- name: golangci-lint
|
||||||
uses: actions/setup-go@v2
|
uses: golangci/golangci-lint-action@v2
|
||||||
with:
|
with:
|
||||||
go-version: 1.16
|
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
|
||||||
|
version: latest
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
# Optional: working directory, useful for monorepos
|
||||||
uses: actions/checkout@v2
|
# working-directory: somedir
|
||||||
|
|
||||||
- name: Cache Go
|
# Optional: golangci-lint command line arguments.
|
||||||
id: cache
|
# args: --issues-exit-code=0
|
||||||
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
|
# Optional: show only new issues if it's a pull request. The default value is `false`.
|
||||||
run: go mod tidy
|
# only-new-issues: true
|
||||||
|
|
||||||
- name: Build linux-x64
|
# Optional: if set to true then the action will use pre-installed Go.
|
||||||
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-x64
|
# skip-go-installation: true
|
||||||
- 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
|
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
|
||||||
uses: actions/upload-artifact@v2
|
# skip-pkg-cache: true
|
||||||
with:
|
|
||||||
name: zerobot-plugin-*
|
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
|
||||||
path: ./artifacts
|
# skip-build-cache: true
|
||||||
|
|||||||
31
.github/workflows/pushlint.yml
vendored
31
.github/workflows/pushlint.yml
vendored
@ -1,31 +0,0 @@
|
|||||||
name: PushLint
|
|
||||||
on: [push]
|
|
||||||
jobs:
|
|
||||||
golangci:
|
|
||||||
name: lint
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: golangci-lint
|
|
||||||
uses: golangci/golangci-lint-action@v2
|
|
||||||
with:
|
|
||||||
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
|
|
||||||
version: latest
|
|
||||||
|
|
||||||
# Optional: working directory, useful for monorepos
|
|
||||||
# working-directory: somedir
|
|
||||||
|
|
||||||
# Optional: golangci-lint command line arguments.
|
|
||||||
# args: --issues-exit-code=0
|
|
||||||
|
|
||||||
# Optional: show only new issues if it's a pull request. The default value is `false`.
|
|
||||||
# only-new-issues: true
|
|
||||||
|
|
||||||
# Optional: if set to true then the action will use pre-installed Go.
|
|
||||||
# skip-go-installation: true
|
|
||||||
|
|
||||||
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
|
|
||||||
# skip-pkg-cache: true
|
|
||||||
|
|
||||||
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
|
|
||||||
# skip-build-cache: true
|
|
||||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -60,5 +60,5 @@ jobs:
|
|||||||
with:
|
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
|
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_path: ./artifacts
|
||||||
asset_name: zerobot-plugin-*
|
asset_name: zerobot-plugin
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
Loading…
Reference in New Issue
Block a user