Skip to content

Commit

Permalink
Iterate reusable release automation workflows (#3851)
Browse files Browse the repository at this point in the history
* Clean up unused envvar

Signed-off-by: Michael Telatynski <[email protected]>

* Make the gitflow workflow reusable

Signed-off-by: Michael Telatynski <[email protected]>

* Add support for resetting dependencies to develop after merge

Signed-off-by: Michael Telatynski <[email protected]>

* Rename workflow file

Signed-off-by: Michael Telatynski <[email protected]>

---------

Signed-off-by: Michael Telatynski <[email protected]>
  • Loading branch information
t3chguy authored Nov 6, 2023
1 parent 311494b commit a25ba7b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ jobs:
done <<< "$DEPENDENCIES"
env:
DEPENDENCIES: ${{ inputs.dependencies }}
FINAL: ${{ inputs.final }}

- name: Prevent develop dependencies
if: inputs.dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ name: Merge master -> develop
on:
push:
branches: [master]
workflow_call:
secrets:
ELEMENT_BOT_TOKEN:
required: true
inputs:
dependencies:
description: List of dependencies to reset.
type: string
required: false
concurrency: ${{ github.workflow }}
jobs:
merge:
Expand Down Expand Up @@ -49,8 +58,38 @@ jobs:
fi
done
- name: Commit and push changes
run: |
git add package.json
git commit -m "Resetting package fields for development"
git push origin develop
- name: Reset dependencies
if: inputs.dependencies
run: |
while IFS= read -r PACKAGE; do
[ -z "$PACKAGE" ] && continue
CURRENT_VERSION=$(cat package.json | jq -r .dependencies[\"$PACKAGE\"])
echo "Current $PACKAGE version is $CURRENT_VERSION"
if [ "$CURRENT_VERSION" == "null" ]
then
echo "Unable to find $PACKAGE in package.json"
exit 1
fi
if [ "$CURRENT_VERSION" == "develop" ]
then
echo "Not updating dependency $PACKAGE"
continue
fi
echo "Resetting $1 to develop branch..."
yarn add "github:matrix-org/$PACKAGE#develop"
git add -u
git commit -m "Reset $PACKAGE back to develop branch"
done <<< "$DEPENDENCIES"
env:
DEPENDENCIES: ${{ inputs.dependencies }}
FINAL: ${{ inputs.final }}

- name: Push changes
run: git push origin develop

0 comments on commit a25ba7b

Please sign in to comment.