Skip to content

Commit

Permalink
Leave a commit status to link to docs
Browse files Browse the repository at this point in the history
[changelog skip]
  • Loading branch information
dahlia committed May 14, 2019
1 parent 5e7a68c commit 7c03a0b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/bin/dist-github-release.sh
Expand Up @@ -52,7 +52,7 @@ tar xvfj /tmp/github-release.tar.bz2 -C /tmp
rm /tmp/github-release.tar.bz2 \

# Fill the description on GitHub releases with the release note
github_user="${GITHUB_REPOSITORY%/*}" \
github_user="${GITHUB_REPOSITORY%/*}"
github_repo="${GITHUB_REPOSITORY#*/}"

if [ "$GITHUB_REPOSITORY" = "planetarium/libplanet" ]; then
Expand Down
23 changes: 21 additions & 2 deletions .github/main.workflow
@@ -1,6 +1,6 @@
workflow "push" {
on = "push"
resolves = ["dist:nuget", "dist:github-release", "docs:publish"]
resolves = ["dist:nuget", "dist:github-release", "docs:status"]
}

workflow "everyday" {
Expand All @@ -12,7 +12,7 @@ action "docs:build" {
uses = "dahlia/actions/docfx@master"

needs = "dist:pack"
# dotnet build & msbuild may occur error if both is running at a time,
# dotnet build & msbuild may occur error if both run simultaneously,
# so in order to wait until one is finished add dist:pack action as
# a dependency of this action.

Expand All @@ -36,6 +36,25 @@ action "docs:publish" {
runs = ["Docs/publish.sh"]
}

action "docs:status" {
uses = "shawnbot/action-status@master"
needs = "docs:publish"
args = [
"--repository=\"$GITHUB_REPOSITORY\"",
"--sha=\"$GITHUB_SHA\"",
"--context=docs",
"--description='Libplanet docs generated by DocFX'",
"--state=success",
"--url=\"$(cat Docs/obj/url.txt)\"",
"--token=\"$GH_CHECK_STATUS_TOKEN\""
]
secrets = [
# We need a token accessible to repo:status, because built-in GITHUB_TOKEN
# is inaccessible to repo:status scope.
"GH_CHECK_STATUS_TOKEN"
]
}

action "dist:version" {
uses = "docker://mcr.microsoft.com/powershell:latest"
args = [".github/bin/dist-version.ps1"]
Expand Down
5 changes: 5 additions & 0 deletions Docs/publish.sh
Expand Up @@ -75,3 +75,8 @@ for _ in 1 2 3; do
done

rm /tmp/github_id

mkdir -p Docs/obj/
github_user="${GITHUB_REPOSITORY%/*}"
github_repo="${GITHUB_REPOSITORY#*/}"
echo -n "https://$github_user.github.io/$github_repo/$slug/" > Docs/obj/url.txt

0 comments on commit 7c03a0b

Please sign in to comment.