Skip to content

Commit 19e430b

Browse files
author
Nate Smith
authored
Merge pull request cli#813 from cli/release-automation
Update documentation site on release
2 parents d2da4a9 + 83502fd commit 19e430b

File tree

3 files changed

+38
-28
lines changed

3 files changed

+38
-28
lines changed

.github/workflows/releases.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,35 @@ jobs:
2626
args: release --release-notes=CHANGELOG.md
2727
env:
2828
GITHUB_TOKEN: ${{secrets.UPLOAD_GITHUB_TOKEN}}
29-
- name: move cards
30-
if: "!contains(github.ref, '-')"
29+
- name: Bump homebrew-core formula
30+
uses: mislav/bump-homebrew-formula-action@v1
31+
if: "!contains(github.ref, '-')" # skip prereleases
32+
with:
33+
formula-name: gh
34+
env:
35+
COMMITTER_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }}
36+
- name: Checkout documentation site
37+
if: "!contains(github.ref, '-')" # skip prereleases
38+
uses: actions/checkout@v2
39+
with:
40+
repository: github/cli.github.com
41+
path: site
42+
fetch-depth: 0
43+
token: ${{secrets.SITE_GITHUB_TOKEN}}
44+
- name: Publish documentation site
45+
if: "!contains(github.ref, '-')" # skip prereleases
46+
run: make site-publish
47+
- name: Move project cards
48+
if: "!contains(github.ref, '-')" # skip prereleases
3149
env:
3250
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
3351
PENDING_COLUMN: 8189733
3452
DONE_COLUMN: 7110130
35-
shell: bash
3653
run: |
3754
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
3855
api() { bin/hub api -H 'accept: application/vnd.github.inertia-preview+json' "$@"; }
3956
cards=$(api projects/columns/$PENDING_COLUMN/cards | jq ".[].id")
4057
for card in $cards; do api projects/columns/cards/$card/moves --field position=top --field column_id=$DONE_COLUMN; done
41-
- name: Bump homebrew-core formula
42-
uses: mislav/bump-homebrew-formula-action@v1
43-
if: "!contains(github.ref, '-')" # skip prereleases
44-
with:
45-
formula-name: gh
46-
env:
47-
COMMITTER_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }}
4858
msi:
4959
needs: goreleaser
5060
runs-on: windows-latest

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,15 @@ site-docs: site
3232
for f in site/manual/gh*.md; do sed -i.bak -e '/^### SEE ALSO/,$$d' "$$f"; done
3333
rm -f site/manual/*.bak
3434
git -C site add 'manual/gh*.md'
35-
git -C site commit -m 'update help docs'
35+
git -C site commit -m 'update help docs' || true
3636
.PHONY: site-docs
37+
38+
site-publish: site-docs
39+
ifndef GITHUB_REF
40+
$(error GITHUB_REF is not set)
41+
endif
42+
sed -i.bak -E 's/(assign version = )".+"/\1"$(GITHUB_REF:refs/tags/v%=%)"/' site/index.html
43+
rm -f site/index.html.bak
44+
git -C site commit -m '$(GITHUB_REF:refs/tags/v%=%)' index.html
45+
git -C site push
46+
.PHONY: site-publish

docs/releasing.md

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,17 @@
11
# Releasing
22

3-
## Test Locally
4-
5-
`go test ./...`
6-
7-
## Push new docs
3+
## Release to production
84

9-
build docs locally: `make site`
5+
This can all be done from your local terminal.
106

11-
build and push docs to production: `make site-docs`
7+
1. `git tag v1.2.3`
8+
2. `git push origin v1.2.3`
9+
3. Wait a few minutes for the build to run <https://github.com/cli/cli/actions>
10+
4. Check <https://github.com/cli/cli/releases>
1211

1312
## Release locally for debugging
1413

1514
A local release can be created for testing without creating anything official on the release page.
1615

17-
1. `env GH_OAUTH_CLIENT_SECRET= GH_OAUTH_CLIENT_ID= goreleaser --skip-validate --skip-publish --rm-dist`
16+
1. `goreleaser --skip-validate --skip-publish --rm-dist`
1817
2. Check and test files in `dist/`
19-
20-
## Release to production
21-
22-
This can all be done from your local terminal.
23-
24-
1. `git tag 'vVERSION_NUMBER' # example git tag 'v0.0.1'`
25-
2. `git push origin vVERSION_NUMBER`
26-
3. Wait a few minutes for the build to run and CI to pass. Look at the [actions tab](https://github.com/cli/cli/actions) to check the progress.
27-
4. Go to <https://github.com/cli/cli/releases> and look at the release

0 commit comments

Comments
 (0)