Skip to content

Commit 7d47cac

Browse files
committed
Skip WordPress.org deploy for prereleases
Versions with a hyphen (e.g., 2.3.0-beta.1) are marked as prerelease on the GitHub release. The WordPress.org deploy workflow skips these.
1 parent 4e88e62 commit 7d47cac

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/release-publish.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ jobs:
3434
echo "version=$VERSION" >> $GITHUB_OUTPUT
3535
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
3636
37+
# Versions with a hyphen (e.g., 2.3.0-beta.1) are prereleases.
38+
if [[ "$VERSION" == *-* ]]; then
39+
echo "prerelease=true" >> $GITHUB_OUTPUT
40+
else
41+
echo "prerelease=false" >> $GITHUB_OUTPUT
42+
fi
43+
3744
- name: Set up PHP
3845
uses: shivammathur/setup-php@v2
3946
with:
@@ -69,10 +76,16 @@ jobs:
6976
MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }}
7077
BODY: ${{ steps.changelog.outputs.body }}
7178
run: |
79+
PRERELEASE_FLAG=""
80+
if [[ "${{ steps.version.outputs.prerelease }}" == "true" ]]; then
81+
PRERELEASE_FLAG="--prerelease"
82+
fi
83+
7284
gh release create "$TAG" \
7385
--target "$MERGE_SHA" \
7486
--title "$TAG" \
7587
--notes "$BODY" \
88+
$PRERELEASE_FLAG \
7689
"build/sqlite-database-integration.zip"
7790
7891
- name: Delete release branch

.github/workflows/release-wporg.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ concurrency:
1111
jobs:
1212
deploy:
1313
name: Deploy plugin to WordPress.org
14-
if: github.repository == 'WordPress/sqlite-database-integration'
14+
if: >-
15+
github.repository == 'WordPress/sqlite-database-integration'
16+
&& github.event.release.prerelease == false
1517
runs-on: ubuntu-latest
1618
environment: WordPress.org
1719
permissions:

0 commit comments

Comments
 (0)