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

update-branch #615

Merged
merged 4 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 11 additions & 2 deletions .github/workflows/stable-releases-1_pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
name: Stable Release Step 1 - Create PR

on:
workflow_dispatch:
schedule:
- cron: "0 10 15 * *"
jobs:
create-release-pull-request:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/stable'
steps:
- uses: actions/checkout@v4
with:
ref: dev-branch
- name: create pull request
run: gh pr create -B stable -H dev-branch --title "Monthly Release PR - $(date '+%Y-%m-%d')" --body "Monthly pull request for creating the latest stable release from staged security fixes, bug fixes, and minor enhancements."
run: |
echo 'Get version to be released and create PR with that in the name'
system_file="$(git rev-parse --show-toplevel)/packages/web/lib/fog/system.class.php"
tag=$(grep "define('FOG_VERSION'" $system_file | sed "s/.*FOG_VERSION', '\([^']*\)');/\1/")
gh pr create -B stable -H dev-branch --title "Stable Release PR For ${tag} - $(date '+%Y-%m-%d')" --body "Pull Request for creating the latest stable release from staged security fixes, bug fixes, and minor enhancements in dev-branch. Created as needed or monthly on 15th of every month, released once tests are passing"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 0 additions & 6 deletions .github/workflows/stable-releases-2_test-validity

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/stable-releases-2_test-validity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Stable Release Step 2 - Validate PR

on:
workflow_dispatch:
# pull_request:
# types:
# - open
# branches:
# - dev-branch
# - stable

jobs:
Merge-After-All-Tests-Passed:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/stable'
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Merge The PR
run: |
echo 'Get the tag'
git fetch origin dev-branch
git checkout dev-branch
system_file="$(git rev-parse --show-toplevel)/packages/web/lib/fog/system.class.php"
tag=$(grep "define('FOG_VERSION'" $system_file | sed "s/.*FOG_VERSION', '\([^']*\)');/\1/")
git checkout stable
echo "merge the pull request bringing dev-branch into stable";
gh pr merge dev-branch --squash --subject "Stable Release - ${tag}";
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# on a monthly pr created from other workflow
# test validity of install
# down the road-test various functions (deploy, capture, API)
# Fix version if needed
# merge pull request with generic commit
# maybe update version if not handled in hook
6 changes: 0 additions & 6 deletions .github/workflows/stable-releases-3_tag-and-release

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/stable-releases-3_tag-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Stable Release Step 3 - Tag and Release

on:
workflow_dispatch:
# pull_request:
# types:
# - closed

jobs:
Tag-and-release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/stable'
steps:
- name: Check-out code to release
uses: actions/checkout@v4
- name: Tag and release
run: |
echo 'Find the version to use for the tag, create the release, and sync the dev and stable branches'
echo 'find the version to create as a tag'
system_file="$(git rev-parse --show-toplevel)/packages/web/lib/fog/system.class.php"
tag=$(grep "define('FOG_VERSION'" $system_file | sed "s/.*FOG_VERSION', '\([^']*\)');/\1/")
echo 'create the tag and release...'
gh release create $tag --latest --generate-notes --target stable
echo 'sync dev-branch with stable branch (merge stable into dev-branch)...'
# git config core.hooksPath .githooks #custom githooks not working in github runner
gh pr create -B dev-branch -H stable --title "merge stable - ${tag} into dev" --body "Pull Request for syncing stable release commit back to dev after a release"
gh pr merge stable --merge --subject "merge stable - ${tag} into dev";
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


# on merge of monthly release pr
# get/calculate current version
# create tag of current version
# create release of new tag
# generate release notes
# send announcements?