-
Notifications
You must be signed in to change notification settings - Fork 91
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 #589 from niklr/nightly_workflow
ci: add dispatch-nightly-build workflow
- Loading branch information
Showing
2 changed files
with
47 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,17 @@ | ||
# Workflows | ||
|
||
## Create Personal Access Token (PAT): | ||
|
||
- Login on GitHub as vitelabs-bot | ||
- Go to https://github.com/settings/tokens | ||
- Generate new token | ||
- Note: WORKFLOW_PUBLIC_REPO | ||
- Expiration: No expiration | ||
- Select scopes: repo -> public_repo | ||
|
||
## Add repo secret | ||
|
||
- Go to Settings -> Secrects -> Actions | ||
- New repository secret | ||
- Name: WORKFLOW_PUBLIC_REPO_PAT | ||
- Value: ghp_... |
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,30 @@ | ||
name: dispatch-nightly-build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Read buildversion | ||
id: buildversion | ||
uses: juliangruber/read-file-action@v1 | ||
with: | ||
path: ./version/buildversion | ||
|
||
- name: Echo buildversion | ||
# trim buildversion and set environment variable | ||
run: echo "${{ steps.buildversion.outputs.content }}" | xargs | echo "buildversion=$(</dev/stdin)" >> $GITHUB_ENV | ||
|
||
- name: Repository Dispatch | ||
uses: peter-evans/repository-dispatch@v2 | ||
with: | ||
token: ${{ secrets.WORKFLOW_PUBLIC_REPO_PAT }} | ||
repository: vitelabs/go-vite-nightly | ||
event-type: nightly-build-event | ||
client-payload: '{"branch": "master", "tag": "${{ env.buildversion }}"}' |