Skip to content

Stable Release Step 3 - Tag and Release #2

Stable Release Step 3 - Tag and Release

Stable Release Step 3 - Tag and Release #2

name: Stable Release Step 3 - Tag and Release
on:
workflow_dispatch:
workflow_call:
jobs:
tag-and-release:
runs-on: ubuntu-22.04
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 }}
discord-success:
needs: tag-and-release
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get tag as env
run: |
tag=$(grep "define('FOG_VERSION'" $system_file | sed "s/.*FOG_VERSION', '\([^']*\)');/\1/")
echo "TAG=$tag" >> $GITHUB_ENV
# - name: Announce success on Discord
# uses: sarisia/actions-status-discord@v1
# with:
# webhook: ${{ secrets.DISCORD_WEBHOOK }}
# title: "New release"
# description: Click [here](https://github.com/fogproject/fogproject/releases/latest) to check the newest release.
# color: 0x00ff00