-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Just publish release branches #60
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ on: | |
push: | ||
branches: | ||
- master | ||
- release/* | ||
- release/2* | ||
pull_request: | ||
workflow_dispatch: | ||
inputs: | ||
|
@@ -27,8 +27,11 @@ jobs: | |
persist-credentials: false | ||
fetch-depth: 0 | ||
|
||
- name: Setup Just | ||
uses: extractions/setup-just@v2 | ||
|
||
- name: Build docs | ||
run: make build | ||
run: just build | ||
|
||
- name: Deploy preview to Netlify | ||
uses: nwtgck/actions-netlify@v2 | ||
|
@@ -46,13 +49,13 @@ jobs: | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | ||
timeout-minutes: 5 | ||
|
||
- name: Build versioned docs | ||
# TODO support publishing non-dev versions | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
- name: Publish versioned docs | ||
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/2')) | ||
env: | ||
PUSH_TOKEN: ${{ secrets.GH_DEPLOY_PUSH_TOKEN }} | ||
run: | | ||
make deploy RELEASE=dev ALIAS=master | ||
just deploy | ||
just list | ||
git push https://[email protected]/${{ github.repository }} publish | ||
|
||
- name: Setup tmate session for debug | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
set shell := ["bash", "-euo", "pipefail", "-c"] | ||
|
||
[private] | ||
@default: build | ||
|
||
export DOCKER_CLI_HINTS := "false" | ||
|
||
image_name := "ghcr.io/githedgehog/hhdocs" | ||
image_version := "20241202" | ||
image := image_name + ":" + image_version | ||
|
||
# Run mkdocs or mike CLI in a container | ||
_run +cmd: | ||
docker run -q --pull=always --rm -v $(pwd):/docs -p 8000:8000 {{image}} {{cmd}} | ||
qmonnet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Build docs site (unversioned) | ||
build: (_run "mkdocs build") | ||
|
||
# Clean generated docs site | ||
clean: | ||
rm -rf site | ||
|
||
# Serve docs site (unversioned, watches for changes) | ||
serve: (_run "mkdocs serve -a 0.0.0.0:8000") | ||
|
||
# List published versions | ||
list: (_run "mike list -b publish") | ||
|
||
branch_current := `git branch --show-current --format "%(refname:short)"` | ||
branch_latest := `git branch --list 'release/2*' --format "%(refname:short)" --sort=-version:refname | head -n 1` | ||
release := trim_start_match(branch_current, "release/") | ||
|
||
_release := if branch_current == "master" { "dev" } else { release } | ||
_alias := if branch_current == branch_latest { "latest" } else if branch_current == "master" { "master" } else { "" } | ||
|
||
# Shoud version that will be deployed (to publish branch) | ||
@version: | ||
echo "Release '{{_release}}' alias '{{_alias}}'" | ||
|
||
# Deploy docs site (versioned) to publish branch | ||
deploy release=_release alias=_alias: (_run "mike deploy -b publish -u" release alias) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we seize this opportunity to rename the branch into
main
instead ofmaster
? 😇There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're using master in other repos (default in the org)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Time to update, then! Dataplane uses
main
🙂There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs are one of the most user-facing repos. For those that are not exposed as well, it's maybe less “important”.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would've been better if it did stick to default so we don't need to switch any :) But I hear you, and we can have that discussion separately. I honestly don't see any reason to bother with it at that stage - in my experience a significant amount (just don't want to say "majority") of OSS projects live completely fine with the
master
branch.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They do, they're fine with
master
indeed. I don't see it as a major drawback for the project.I see changing to
main
as a commitment, though. I do believe that “master” and “slave” have a strong meaning, and should probably never have been used in tech in the first place. But regardless of what I think, there are some people, maybe a small number, to whom the terminology “master”/“slave” brings painful associations, and to whom it matters. They might contribute to the project nonetheless, but not feel as comfortable doing so as they could. By naming our branch differently we acknowledge that this terminology can hurt, and we do our part to keep these words out of the field. More generally, we also indicate that we care about creating an inclusive community. Or at least, we take one step closer to it.