From b8ecf1fab56c28397806ca1f6b34519380caa1a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Wed, 22 Apr 2020 15:16:24 +0200 Subject: [PATCH 1/4] Bump homebrew formula immediately after release --- .github/workflows/releases.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 2f9908167..e9d183592 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -26,6 +26,13 @@ jobs: args: release --release-notes=CHANGELOG.md env: GITHUB_TOKEN: ${{secrets.UPLOAD_GITHUB_TOKEN}} + - name: Bump homebrew-core formula + uses: mislav/bump-homebrew-formula-action@v1 + if: "!contains(github.ref, '-')" # skip prereleases + with: + formula-name: gh + env: + COMMITTER_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }} - name: move cards if: "!contains(github.ref, '-')" env: @@ -38,13 +45,6 @@ jobs: 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 - with: - formula-name: gh - env: - COMMITTER_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }} msi: needs: goreleaser runs-on: windows-latest From 60a67b852a43469df09035445131b54de5e5e933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Wed, 22 Apr 2020 15:59:44 +0200 Subject: [PATCH 2/4] Automatically generate site docs on release --- .github/workflows/releases.yml | 16 +++++++++++++--- Makefile | 10 ++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index e9d183592..7fe2ca3af 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -33,13 +33,23 @@ jobs: formula-name: gh env: COMMITTER_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }} - - name: move cards - if: "!contains(github.ref, '-')" + - 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 - 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' "$@"; } diff --git a/Makefile b/Makefile index 5a93dac9b..ffbd5bd7e 100644 --- a/Makefile +++ b/Makefile @@ -34,3 +34,13 @@ site-docs: site git -C site add 'manual/gh*.md' git -C site commit -m 'update help docs' .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 From 1b12ef863ef533afbf5e47779994a66c25ffe561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Wed, 22 Apr 2020 15:59:58 +0200 Subject: [PATCH 3/4] Simplify release documentation --- docs/releasing.md | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/docs/releasing.md b/docs/releasing.md index 00646a18a..dfaebd76a 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -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 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 +4. Check + +## 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/` From 83502fdbae866b5cd5c8aeba4ef6608c80d3f419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Wed, 22 Apr 2020 16:13:16 +0200 Subject: [PATCH 4/4] Avoid failing if site docs are already up-to-date --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ffbd5bd7e..f2b4805c8 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ 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