Skip to content

Commit 19cef1d

Browse files
authored
Merge pull request #425 from Shopify/release-on-tags
Allow for creating canary releases by tagging commits
2 parents 6247257 + 57ae8b2 commit 19cef1d

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- main
7+
tags:
8+
- canary/*
79

810
jobs:
911
build-debs:
@@ -45,7 +47,14 @@ jobs:
4547
echo "sha256sum:"
4648
cat ghostferry-$GITHUB_SHA.sha256sum
4749
48-
- name: Releasing Ghostferry to Github
49-
run: gh release create --target ${GITHUB_REF#refs/heads/} -p release-${GITHUB_SHA::7} ghostferry*
50+
- name: Releasing production Ghostferry
51+
if: ${{ github.ref_type == "branch" && github.ref_name == "main" }}
52+
run: gh release create release-${GITHUB_SHA::7} --target ${{ github.ref_name }} --prerelease ghostferry*
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
56+
- name: Releasing canary Ghostferry
57+
if: ${{ github.ref_type == "tag" && startsWith(github.ref_name, "canary/") }}
58+
run: gh release create ${{github.ref_name}} --prerelease --verify-tag --notes-from-tag --latest=false ghostferry*
5059
env:
5160
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## [Unreleased]
6+
7+
### Added
8+
9+
- Changelog.
10+
11+
## [1.1.0]
12+
13+
Past releases.

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,23 @@ or
8282
Run a specific test
8383

8484
`DEBUG=1 ruby -Itest test/integration/trivial_test.rb -n "TrivialIntegrationTest#test_logged_query_omits_columns"`
85+
86+
Releasing new version
87+
---------------------
88+
89+
### Canary
90+
91+
Tag your commit with `canary/*` and push, i.e.
92+
93+
```bash
94+
git tag --sign --message="Initial support for UUIDs as pagination keys" canary/v1.1.2-uuid-pagination-keys-alpha-1
95+
git push origin --tags
96+
```
97+
98+
This will create the release named by tag.
99+
100+
### Production
101+
102+
Final releases are created automatically on merge to `main` branch, they will end up with `release-SHA` name.
103+
104+
Remember to update version prior to bigger releases in `Makefile` along with updating the `CHANGELOG.md`.

0 commit comments

Comments
 (0)