Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from Nebell/soc
[SoC] Go-wechaty Github Actions Optimization
- Loading branch information
Showing
4 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
name: Update Dependencies | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
repository_dispatch: | ||
types: [ updatedeps ] | ||
|
||
jobs: | ||
UpdateDep: | ||
name: Update Dependency | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Go environment | ||
uses: actions/setup-go@v2.1.0 | ||
with: | ||
go-version: 1.14.4 # optional | ||
- name: Update Dependency | ||
run: go get -u ./... | ||
|
||
- name: Test | ||
run: | | ||
make install | ||
make test | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: Update dependencies | ||
title: Update dependencies | ||
body: | | ||
- Dependency updates | ||
Auto-generated by [create-pull-request][1] | ||
[1]: https://github.com/peter-evans/create-pull-request | ||
branch: update-dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Test on Windows | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
Build: | ||
name: Build on Windows | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Go environment | ||
uses: actions/setup-go@v2.1.0 | ||
with: | ||
go-version: 1.14.4 # optional | ||
|
||
- name: Build Dingdongbot | ||
run: | | ||
go vet ./... | ||
make install | ||
make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM golang AS builder | ||
WORKDIR /root/ | ||
COPY . src | ||
ENV GOPROXY https://goproxy.io,direct | ||
RUN cd src && CGO_ENABLED=0 GOOS=linux go build -o ding-dong-bot -v ./examples/ding-dong-bot.go | ||
|
||
FROM alpine AS prod | ||
WORKDIR /root/ | ||
COPY --from=builder /root/src/ding-dong-bot . | ||
ENTRYPOINT ["./ding-dong-bot"] |