Skip to content

Commit

Permalink
Release new version of the WAF package
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelxpn authored and matticbot committed Mar 22, 2024
1 parent 439d2a7 commit 135932f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .github/files/autorelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ set -eo pipefail
: "${GITHUB_REPOSITORY:?Build argument needs to be set and non-empty.}"

## Determine tag
if [[ ! "$GITHUB_REF" =~ ^refs/tags/v?[0-9]+(\.[0-9]+)+$ ]]; then
if [[ ! "$GITHUB_REF" =~ ^refs/tags/v?[0-9]+(\.[0-9]+)+(-[a-z0-9._-]+)?$ ]]; then
echo "::error::Expected GITHUB_REF like \`refs/tags/v1.2.3\` or \`refs/tags/1.2.3\`, got \`$GITHUB_REF\`"
exit 1
fi
TAG="${GITHUB_REF#refs/tags/}"

## Check for alphas
if [[ "$TAG" =~ -(alpha|a\.[0-9]*[02468])$ ]]; then
echo "Not creating a release for alpha version $TAG"
exit 0
fi
echo "Creating release for $TAG"

## Determine slug and title format.
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/autorelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ on:
push:
tags:
- 'v?[0-9]+.[0-9]+'
- 'v?[0-9]+.[0-9]+-*'
- 'v?[0-9]+.[0-9]+.[0-9]+'
- 'v?[0-9]+.[0-9]+.[0-9]+-*'
- 'v?[0-9]+.[0-9]+.[0-9]+.[0-9]+'
- 'v?[0-9]+.[0-9]+.[0-9]+.[0-9]+-*'

jobs:
publish:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/autotagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
VER=$(sed -nEe 's/^## \[?([^]]*)\]? - .*/\1/;T;p;q' CHANGELOG.md || true)
echo "Version from changelog is ${VER:-<unknown>}"
echo "version=$VER" >> "$GITHUB_OUTPUT"
if [[ "$VER" =~ ^[0-9]+(\.[0-9]+)+$ ]]; then
if [[ "$VER" =~ ^[0-9]+(\.[0-9]+)+(-[a-z0-9._-]+)?$ && ! "$VER" =~ -(alpha|a\.[0-9]*[02468])$ ]]; then
echo "Version $VER ok to tag"
echo "run=true" >> "$GITHUB_OUTPUT"
else
Expand All @@ -77,7 +77,7 @@ jobs:
run: |
RUN=true
if [[ -e composer.json ]]; then
TMP=$(jq -r '.require // {} | to_entries[] | select( .value | test( "-(alpha|a.[0-9]+)$" ) ) | "\(.key) (\(.value))"' composer.json)
TMP=$(jq -r '.require // {} | to_entries[] | select( .value | test( "-(alpha|a\\.[0-9]*[02468])$" ) ) | "\(.key) (\(.value))"' composer.json)
if [[ -n "$TMP" ]]; then
echo "::notice::Not tagging due to -alpha deps on ${TMP//$'\n'/ }"
RUN=false
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {},
"require-dev": {
"automattic/jetpack-changelogger": "^4.1.1"
"automattic/jetpack-changelogger": "^4.1.2"
},
"scripts": {
"build-development": [
Expand Down

0 comments on commit 135932f

Please sign in to comment.