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

feat: CI/CD Merging from next #183

Merged
merged 37 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c9896f7
Push new workflow
kschrief Feb 23, 2024
0372e6e
Remove scary github actions
kschrief Feb 23, 2024
82f409f
Update
kschrief Feb 23, 2024
fa37994
Trigger
kschrief Feb 23, 2024
b1fe3bd
Trigger
kschrief Feb 23, 2024
f5ac990
Trigger
kschrief Feb 23, 2024
806e737
Introduce conflict
kschrief Feb 23, 2024
b423f5c
Yes. Good.
kschrief Feb 23, 2024
2aa497c
Get version number
kschrief Feb 27, 2024
337d36e
Get version number
kschrief Feb 27, 2024
90895c6
Get version number
kschrief Feb 27, 2024
d829527
Commit version change
kschrief Feb 27, 2024
3cdbd3c
Commit version change
kschrief Feb 27, 2024
814e1b5
Commit version change
kschrief Feb 27, 2024
37a11a0
Exit 0
kschrief Feb 27, 2024
a6bd102
Versions
kschrief Feb 27, 2024
70025d4
Versions
kschrief Feb 27, 2024
39fe788
Versions
kschrief Feb 27, 2024
9849b7c
Versions
kschrief Feb 27, 2024
63c4013
Conflict
kschrief Feb 27, 2024
cf09ec1
Conflict
kschrief Feb 27, 2024
dddf189
Conflict
kschrief Feb 27, 2024
0848c86
Conflict
kschrief Feb 27, 2024
e6171a9
Conflict
kschrief Feb 27, 2024
fa25feb
Finishing touches
kschrief Feb 28, 2024
b2a5c5f
Finishing touches
kschrief Feb 28, 2024
d4690ba
Merge to main
kschrief Feb 28, 2024
e67ba1f
Change next->main script
kschrief Feb 28, 2024
682a750
Better commit message
kschrief Feb 28, 2024
8aab3df
Better commit message
kschrief Feb 28, 2024
3b81a54
Reverse temporary changes
kschrief Mar 8, 2024
40c70b6
Reverse versioning override
kschrief Mar 25, 2024
5ebcecc
Silly change
kschrief Mar 25, 2024
2ca3e70
Forgot to checkout next-major
kschrief Mar 25, 2024
23bc305
Merge branch 'next' into next
kschrief Apr 2, 2024
1348d85
Slimmed down actions
kschrief Apr 5, 2024
77ceea9
GH Action Rename
kschrief Apr 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/merge-to-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Attempt to merge next to main
on:
workflow_dispatch:

jobs:
# Check if next can merge into main
perform_merge:
name: Perform merge if "next" can merge into "main"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
repo-token: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }}
persist-credentials: true

# Set user identity
- name: Set-Identity
run: |
git config --global user.email "${{ secrets.GLOBAL_GITHUB_EMAIL }}"
git config --global user.name "${{ secrets.GLOBAL_GITHUB_USER }}"

# Checkout "main"
- name: Checkout main
run: git checkout "main"

- name: Perform the merge from next to main
run: |
git merge next
git push origin "main"
echo "Push to main succeeded"

# If the merge cannot be performed, let stakeholders know
message_on_failure:
name: Merge failure
needs: perform_merge
runs-on: ubuntu-latest
if: ${{ failure() }}

steps:
- name: Post error message (To-Do)
run: echo "Next cannot be merged into main cleanly"
72 changes: 72 additions & 0 deletions .github/workflows/merge-to-next-major.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Attempt to merge next to next-major
on:
workflow_dispatch:
push:
branches:
- "next"

jobs:
# Check if next can merge into next-major
perform_merge:
name: Perform merge if "next" can merge into "next-major"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
repo-token: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }}
persist-credentials: true

# Set user identity
- name: Set-Identity
run: |
git config --global user.email "${{ secrets.GLOBAL_GITHUB_EMAIL }}"
git config --global user.name "${{ secrets.GLOBAL_GITHUB_USER }}"

# Checkout "next-major"
- name: Checkout next-major
run: git checkout "next-major"

# Get the "next-major" version number
- name: Extract next-major version
id: extract_version
run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')"

# Checkout "next"
- name: Checkout next
run: git checkout "next"

# Update "next" version to match "next-major"
- name: Update "next" version to match "next-major"
run: |
jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json

if diff -q "package.json" "temp.json" >/dev/null; then
echo "Versions are identical. No change required."
rm temp.json
else
mv temp.json package.json
git add package.json && git commit -m "Sync version to ${{ steps.extract_version.outputs.version }}"
fi

# Checkout "next-major"
- name: Checkout next-major
run: git checkout "next-major"

- name: Perform the merge from next to next-major
run: |
git merge next
git push origin "next-major"
echo "Push to next-major succeeded"

# If the merge cannot be performed, let stakeholders know
message_on_failure:
name: Merge failure
needs: perform_merge
runs-on: ubuntu-latest
if: ${{ failure() }}

steps:
- name: Post error message (To-Do)
run: echo "Next cannot be merged into next-major cleanly"
Loading