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: Upload Build Artifact uses: actions/upload-artifact@v2 with: name: zerobot-plugin path: ./artifacts/zerobot-plugin-*