run WeiboTask #192
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
name: 'run WeiboTask' | |
on: | |
watch: | |
types: started | |
workflow_dispatch: | |
# schedule: | |
# - cron: '0 16 * * *' #凌晨00:00执行' | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
if: github.event.repository.owner.id == github.event.sender.id | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: master | |
- name: 生成配置文件 | |
run: | | |
if [ -z "${{ secrets.ALC }}" ]; then | |
echo "没有配置secrets(ALC)" | |
exit -1 | |
fi | |
echo '{"SCKEY":"${{ secrets.SCKEY }}","Stime": [0, 0],"Cookies":[{"name":"ALC","value":"${{ secrets.ALC }}","domain":".login.sina.com.cn"},{"name":"ALF","value":"","domain":".weibo.com"}]}' >config.json | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: '1.15.6' | |
- run: go version | |
- name: 构建和执行WeiboTask | |
run: | | |
export GOPATH=$(pwd) | |
go build -o ./WeiboTask WeiboTask | |
./WeiboTask |