Skip to content

Commit

Permalink
Merge pull request #1156 from matomo-org/allow-force-deploy
Browse files Browse the repository at this point in the history
allow deploying to existing tag if desired and make sure version is correct when specified manually in release workflow
  • Loading branch information
diosmosis authored Jun 18, 2024
2 parents 9d84cc0 + c9c7d99 commit 50b5fc7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ on:
password:
description: 'Release password'
required: true
force:
description: 'Force (0 or 1)'
required: false
default: 0

env:
RELEASE_PASSWORD: ${{ secrets.RELEASE_PASSWORD }}
Expand Down Expand Up @@ -60,11 +64,18 @@ jobs:
- run: git lfs pull
- name: "Check tag"
run: |
existing_version=$(cat readme.txt | grep -oP "Stable tag: \K(.+)")
if [[ -n "${{ github.event.inputs.version }}" ]]
then
version="${{ github.event.inputs.version }}"
if [[ "$existing_version" != "$version" ]]; then
echo "Version in readme.txt not set correctly, aborting."
exit 1
fi
else
version=$(cat readme.txt | grep -oP "Stable tag: \K(.+)")
version=$existing_version
fi
echo "Version to build: '$version'"
Expand Down Expand Up @@ -110,3 +121,5 @@ jobs:
echo "update=false" >> $GITHUB_OUTPUT
shell: bash
env:
FORCE_DEPLOY: ${{ github.event.inputs.force }}
2 changes: 1 addition & 1 deletion scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ svn update --set-depth infinity assets
svn update --set-depth infinity trunk
svn update --set-depth immediates tags

if [[ -d "tags/$VERSION" ]]; then
if [[ -d "tags/$VERSION" ]] || [[ "$FORCE_DEPLOY" == "1" ]]; then
echo "ℹ︎ Version $VERSION of plugin $SLUG was already published";
exit
fi
Expand Down

0 comments on commit 50b5fc7

Please sign in to comment.