Skip to content

Commit d675623

Browse files
authored
Merge pull request #589 from niklr/nightly_workflow
ci: add dispatch-nightly-build workflow
2 parents f3cf3da + 04984a5 commit d675623

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.github/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Workflows
2+
3+
## Create Personal Access Token (PAT):
4+
5+
- Login on GitHub as vitelabs-bot
6+
- Go to https://github.com/settings/tokens
7+
- Generate new token
8+
- Note: WORKFLOW_PUBLIC_REPO
9+
- Expiration: No expiration
10+
- Select scopes: repo -> public_repo
11+
12+
## Add repo secret
13+
14+
- Go to Settings -> Secrects -> Actions
15+
- New repository secret
16+
- Name: WORKFLOW_PUBLIC_REPO_PAT
17+
- Value: ghp_...
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: dispatch-nightly-build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-18.04
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Read buildversion
15+
id: buildversion
16+
uses: juliangruber/read-file-action@v1
17+
with:
18+
path: ./version/buildversion
19+
20+
- name: Echo buildversion
21+
# trim buildversion and set environment variable
22+
run: echo "${{ steps.buildversion.outputs.content }}" | xargs | echo "buildversion=$(</dev/stdin)" >> $GITHUB_ENV
23+
24+
- name: Repository Dispatch
25+
uses: peter-evans/repository-dispatch@v2
26+
with:
27+
token: ${{ secrets.WORKFLOW_PUBLIC_REPO_PAT }}
28+
repository: vitelabs/go-vite-nightly
29+
event-type: nightly-build-event
30+
client-payload: '{"branch": "master", "tag": "${{ env.buildversion }}"}'

0 commit comments

Comments
 (0)