Merge pull request #813 from cli/release-automation
Update documentation site on release
This commit is contained in:
commit
19e430bb53
3 changed files with 44 additions and 34 deletions
34
.github/workflows/releases.yml
vendored
34
.github/workflows/releases.yml
vendored
|
|
@ -26,18 +26,6 @@ jobs:
|
|||
args: release --release-notes=CHANGELOG.md
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.UPLOAD_GITHUB_TOKEN}}
|
||||
- name: move cards
|
||||
if: "!contains(github.ref, '-')"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
PENDING_COLUMN: 8189733
|
||||
DONE_COLUMN: 7110130
|
||||
shell: bash
|
||||
run: |
|
||||
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
|
||||
api() { bin/hub api -H 'accept: application/vnd.github.inertia-preview+json' "$@"; }
|
||||
cards=$(api projects/columns/$PENDING_COLUMN/cards | jq ".[].id")
|
||||
for card in $cards; do api projects/columns/cards/$card/moves --field position=top --field column_id=$DONE_COLUMN; done
|
||||
- name: Bump homebrew-core formula
|
||||
uses: mislav/bump-homebrew-formula-action@v1
|
||||
if: "!contains(github.ref, '-')" # skip prereleases
|
||||
|
|
@ -45,6 +33,28 @@ jobs:
|
|||
formula-name: gh
|
||||
env:
|
||||
COMMITTER_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }}
|
||||
- name: Checkout documentation site
|
||||
if: "!contains(github.ref, '-')" # skip prereleases
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: github/cli.github.com
|
||||
path: site
|
||||
fetch-depth: 0
|
||||
token: ${{secrets.SITE_GITHUB_TOKEN}}
|
||||
- name: Publish documentation site
|
||||
if: "!contains(github.ref, '-')" # skip prereleases
|
||||
run: make site-publish
|
||||
- name: Move project cards
|
||||
if: "!contains(github.ref, '-')" # skip prereleases
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
PENDING_COLUMN: 8189733
|
||||
DONE_COLUMN: 7110130
|
||||
run: |
|
||||
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
|
||||
api() { bin/hub api -H 'accept: application/vnd.github.inertia-preview+json' "$@"; }
|
||||
cards=$(api projects/columns/$PENDING_COLUMN/cards | jq ".[].id")
|
||||
for card in $cards; do api projects/columns/cards/$card/moves --field position=top --field column_id=$DONE_COLUMN; done
|
||||
msi:
|
||||
needs: goreleaser
|
||||
runs-on: windows-latest
|
||||
|
|
|
|||
12
Makefile
12
Makefile
|
|
@ -32,5 +32,15 @@ site-docs: site
|
|||
for f in site/manual/gh*.md; do sed -i.bak -e '/^### SEE ALSO/,$$d' "$$f"; done
|
||||
rm -f site/manual/*.bak
|
||||
git -C site add 'manual/gh*.md'
|
||||
git -C site commit -m 'update help docs'
|
||||
git -C site commit -m 'update help docs' || true
|
||||
.PHONY: site-docs
|
||||
|
||||
site-publish: site-docs
|
||||
ifndef GITHUB_REF
|
||||
$(error GITHUB_REF is not set)
|
||||
endif
|
||||
sed -i.bak -E 's/(assign version = )".+"/\1"$(GITHUB_REF:refs/tags/v%=%)"/' site/index.html
|
||||
rm -f site/index.html.bak
|
||||
git -C site commit -m '$(GITHUB_REF:refs/tags/v%=%)' index.html
|
||||
git -C site push
|
||||
.PHONY: site-publish
|
||||
|
|
|
|||
|
|
@ -1,27 +1,17 @@
|
|||
# Releasing
|
||||
|
||||
## Test Locally
|
||||
|
||||
`go test ./...`
|
||||
|
||||
## Push new docs
|
||||
|
||||
build docs locally: `make site`
|
||||
|
||||
build and push docs to production: `make site-docs`
|
||||
|
||||
## Release locally for debugging
|
||||
|
||||
A local release can be created for testing without creating anything official on the release page.
|
||||
|
||||
1. `env GH_OAUTH_CLIENT_SECRET= GH_OAUTH_CLIENT_ID= goreleaser --skip-validate --skip-publish --rm-dist`
|
||||
2. Check and test files in `dist/`
|
||||
|
||||
## Release to production
|
||||
|
||||
This can all be done from your local terminal.
|
||||
|
||||
1. `git tag 'vVERSION_NUMBER' # example git tag 'v0.0.1'`
|
||||
2. `git push origin vVERSION_NUMBER`
|
||||
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.
|
||||
4. Go to <https://github.com/cli/cli/releases> and look at the release
|
||||
1. `git tag v1.2.3`
|
||||
2. `git push origin v1.2.3`
|
||||
3. Wait a few minutes for the build to run <https://github.com/cli/cli/actions>
|
||||
4. Check <https://github.com/cli/cli/releases>
|
||||
|
||||
## Release locally for debugging
|
||||
|
||||
A local release can be created for testing without creating anything official on the release page.
|
||||
|
||||
1. `goreleaser --skip-validate --skip-publish --rm-dist`
|
||||
2. Check and test files in `dist/`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue