Skip to content
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

After pushing and tagging a release commit, build.yaml should rebase the staging branch on top of main. #266

Closed
jenstroeger opened this issue Jul 31, 2022 · 5 comments

Comments

@jenstroeger
Copy link
Owner

For details, see #259 (comment).

@jenstroeger
Copy link
Owner Author

As per linked comment:

This (change) would hardwire the branch name staging into the process, though, and maybe we should make it configurable (somewhat related to #259 (comment))?

I’m ok with using staging in the Action itself, and then document in the README that users may want to change that branch name. I’ve seen develop or beta used in the same scenario.

@jenstroeger
Copy link
Owner Author

jenstroeger commented Sep 1, 2022

So I think we want to add another step after this one:

- name: Push the release
run: |
git push
git push --tags

For example

--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -68,6 +68,13 @@ jobs:
         git push
         git push --tags
 
+    - name: Rebase staging branch
+      continue-on-error: true
+      run: |
+        git checkout staging
+        git rebase main
+        git push
+
   # When triggered by the version bump commit, build the package and publish the release artifacts.
   build:

We’ve already checked out all branches a few steps before:

- name: Check out repository
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
with:
fetch-depth: 0
token: ${{ secrets.REPO_ACCESS_TOKEN }}

That would only work, I think, if both main and staging branch keep their history in sync…

@behnazh
Copy link
Collaborator

behnazh commented Sep 1, 2022

Sounds fine with me. But before merging that we should investigate this whole branch protection vs automatic release through pull requests to make sure the histories would be in sync. At least we should understand why it's not working as we want in GitHub.

@jenstroeger
Copy link
Owner Author

There’s also this problem: what if the git rebase main fails because of conflicts? The chance is slim, but still somebody may have merged new commits into staging while the Release workflow was checking the new release…

@jenstroeger
Copy link
Owner Author

PR #536, commit 7d9f0a4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants