Skip to content

Commit

Permalink
ci: automate release post tag push (cosmos#6230)
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored May 25, 2020
1 parent b8cac82 commit 21a9cb9
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Lint
# Lint runs golangci-lint over the entire cosmos-sdk repository
# This workflow is run on every pull request and push to master
# The `golangci` will pass without running if no *.{go, mod, sum} files have been changed.
on:
pull_request:
push:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Protobuf
on:
# Protobuf runs buf (https://buf.build/) lint and check-breakage
# This workflow is only run when a .proto file has been changed
on:
pull_request:
paths:
- '**.proto'
paths:
- "**.proto"
jobs:
lint:
runs-on: ubuntu-latest
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/release-sims.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Release Sims
on:
pull_request:
branches:
- 'rc**'

# Release Sims workflow runs long-lived (multi-seed & large block size) simulations
# This workflow only runs on a pull request when the branch contains rc** (rc1/vX.X.x)
on:
pull_request:
branches:
- "rc**"

jobs:
cleanup-runs:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Sims
# Sims workflow runs multiple types of simulations (nondeterminism, import-export, after-import, multi-seed-short)
# This workflow will run on all Pull Requests, if a .go, .mod or .sum file have been changed
on:
pull_request:
jobs:
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release
# This workflow helps with creating releases.
# This job will only be triggered when a tag (vX.X.x) is pushed
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.14
- name: Unshallow
run: git fetch --prune --unshallow
- name: Create release
uses: goreleaser/goreleaser-action@v2
with:
args: release --rm-dist --release-notes ./RELEASE_CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Code Coverage
name: Uint-Tests / Code Coverage
# Uint-Tests / Code Coverage workflow runs unit tests and uploads a code coverage report
# This workflow is run on pushes to master & every Pull Requests where a .go, .mod, .sum have been changed
on:
pull_request:
push:
Expand Down
27 changes: 27 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
project_name: cosmos-sdk

release:
github:
owner: cosmos
name: cosmos-sdk

builds:
- skip: true

archives:
- format: tar.gz
wrap_in_directory: true
format_overrides:
- goos: windows
format: zip
name_template: "{{ .Binary }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
files:
- LICENSE
- README.md

snapshot:
name_template: SNAPSHOT-{{ .Commit }}

changelog:
skip: true
7 changes: 5 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ only pull requests targeted directly against master.
- **no PRs targeting this branch should be merged unless exceptional circumstances arise**
- On the `RC` branch, prepare a new version section in the `CHANGELOG.md`
- All links must be link-ified: `$ python ./scripts/linkify_changelog.py CHANGELOG.md`
- Copy the entries into a `RELEASE_CHANGELOG.md`, this is needed so the bot knows which entries to add to the release page on github.
- Kick off a large round of simulation testing (e.g. 400 seeds for 2k blocks)
- If errors are found during the simulation testing, commit the fixes to `master`
and create a new `RC` branch (making sure to increment the `rcN`)
Expand All @@ -234,13 +235,15 @@ releases will be based off of that release.
- checkout a new branch `rcN/vX.X.X`
- cherry pick the desired changes from `master`
- these changes should be small and NON-BREAKING (both API and state machine)
- add entries to CHANGELOG.md and remove corresponding pending log entries
- create a `RELEASE_CHANGELOG.md`, add entires.
- this is needed so the bot knows which entries to add to the release page on github.
- checkout a new branch `release/vX.X.X` based off of the previous release
- create a PR merging `rcN/vX.X.X` into `release/vX.X.X`
- run tests and simulations (noted in [Release Procedure](#release-procedure))
- after tests and simulation have successfully completed, merge the `RC` branch into `release/vX.X.X`
- Make sure to delete the `RC` branch
- create a PR into `master` containing ONLY the CHANGELOG.md updates
- create a PR into `master` containing ONLY CHANGELOG.md updates
- Do not push `RELEASE_CHANGELOG.md` to master
- tag (use `git tag -a`) then push the tags (`git push --tags`)
## Code Owner Membership
Expand Down

0 comments on commit 21a9cb9

Please sign in to comment.