Skip to content

Commit 0e4c8a2

Browse files
authored
Merge pull request #195 from hookdeck/chore/git-workflow
chore: Update branching workflow to single-branch strategy
2 parents 7118b71 + 776f324 commit 0e4c8a2

File tree

2 files changed

+82
-14
lines changed

2 files changed

+82
-14
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ name: test
33
on:
44
workflow_run:
55
workflows: ["Dependabot PR Check"]
6-
types:
6+
types:
77
- completed
88
pull_request:
99
branches:
1010
- main
11-
- next
1211

1312
jobs:
1413
build-mac:
@@ -77,6 +76,6 @@ jobs:
7776
uses: goreleaser/goreleaser-action@v5
7877
with:
7978
version: v2.10.2
80-
args: release --skip=publish --snapshot -f .goreleaser/windows.yml --clean
79+
args: release --skip=publish --snapshot -f .goreleaser/windows.yml --clean
8180
env:
8281
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}

README.md

Lines changed: 80 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,19 +1121,13 @@ scoop install hookdeck-beta
11211121
docker run hookdeck/hookdeck-cli:v1.2.3-beta.0 version
11221122
```
11231123

1124-
### Production Releases
1124+
## Release Process
11251125

1126-
Production releases are created from the `main` branch using GitHub's release interface.
1126+
The release workflow supports tagging from ANY branch - it automatically detects which branch contains the tag.
11271127

1128-
**Process:**
1128+
### Stable Release (Preferred Method: GitHub UI)
11291129

1130-
1. Merge the `next` branch into `main`:
1131-
```sh
1132-
git checkout main
1133-
git pull origin main
1134-
git merge next
1135-
git push origin main
1136-
```
1130+
1. Ensure all tests pass on `main`
11371131
2. Go to the [GitHub Releases page](https://github.com/hookdeck/hookdeck-cli/releases)
11381132
3. Click "Draft a new release"
11391133
4. Create a new tag with a stable version (e.g., `v1.3.0`)
@@ -1150,7 +1144,82 @@ The GitHub Actions workflow will automatically:
11501144
- Scoop: `hookdeck` package
11511145
- Docker: Updates both the version tag and `latest`
11521146

1153-
**Note:** Only stable releases (without pre-release identifiers) will update the `latest` tags across all distribution channels.
1147+
**Alternative (Command Line):**
1148+
```bash
1149+
git checkout main
1150+
git tag v1.3.0
1151+
git push origin v1.3.0
1152+
# Then create release notes on GitHub Releases page
1153+
```
1154+
1155+
### Pre-release from Main (General Beta Testing)
1156+
1157+
**Preferred Method: GitHub UI**
1158+
1. Ensure `main` branch is in the desired state
1159+
2. Go to the [GitHub Releases page](https://github.com/hookdeck/hookdeck-cli/releases)
1160+
3. Click "Draft a new release"
1161+
4. Create a new tag with pre-release version (e.g., `v1.3.0-beta.1`)
1162+
5. Target the `main` branch
1163+
6. Check "Set as a pre-release"
1164+
7. Publish the release
1165+
8. GitHub Actions will build and publish with npm tag `beta`
1166+
1167+
**Alternative (Command Line):**
1168+
```bash
1169+
git checkout main
1170+
git tag v1.3.0-beta.1
1171+
git push origin v1.3.0-beta.1
1172+
```
1173+
1174+
### Pre-release from Feature Branch (Feature-Specific Testing)
1175+
1176+
For testing a specific feature in isolation before merging to main:
1177+
1178+
**Preferred Method: GitHub UI**
1179+
1. Ensure your feature branch is pushed to origin
1180+
2. Go to the [GitHub Releases page](https://github.com/hookdeck/hookdeck-cli/releases)
1181+
3. Click "Draft a new release"
1182+
4. Create a new tag with pre-release version (e.g., `v1.3.0-beta.1`)
1183+
5. Target your feature branch (e.g., `feat/my-feature`)
1184+
6. Check "Set as a pre-release"
1185+
7. Add notes about what's being tested
1186+
8. Publish the release
1187+
9. GitHub Actions will automatically detect the branch and build from it
1188+
1189+
**Alternative (Command Line):**
1190+
```bash
1191+
git checkout feat/my-feature
1192+
git tag v1.3.0-beta.1
1193+
git push origin v1.3.0-beta.1
1194+
# Then create release notes on GitHub Releases page
1195+
```
1196+
1197+
**Note:** Only stable releases (without pre-release identifiers like `-beta`, `-alpha`) will update the `latest` tags across all distribution channels.
1198+
1199+
## Repository Setup
1200+
1201+
### GitHub Repository Settings
1202+
1203+
To maintain code quality and protect the main branch, configure the following settings in your GitHub repository:
1204+
1205+
**Default Branch:**
1206+
1. Go to Settings → Branches
1207+
2. Set default branch to `main` (if not already set)
1208+
1209+
**Branch Protection Rules for `main`:**
1210+
1. Go to Settings → Branches → Branch protection rules
1211+
2. Add rule for `main` branch
1212+
3. Enable the following settings:
1213+
- **Require a pull request before merging**
1214+
- Require approvals: 1 (or as needed for your team)
1215+
- **Require status checks to pass before merging**
1216+
- Require branches to be up to date before merging
1217+
- Add status check: `build-linux`, `build-mac`, `build-windows` (from test workflow)
1218+
- **Do not allow bypassing the above settings**
1219+
- **Restrict force pushes** (recommended)
1220+
- **Restrict deletions** (recommended)
1221+
1222+
These settings ensure that all changes to `main` go through proper review and testing before being merged.
11541223

11551224
## License
11561225

0 commit comments

Comments
 (0)