Skip to content

Commit

Permalink
Fix Github Actions versioned image push (#994)
Browse files Browse the repository at this point in the history
* Fix push semver versioned ci image not being pushed if has semver suffix.

* Add comments to document semver regex.

* Replace regular expression matcher with grep -P for Perl regex style matching.
  • Loading branch information
mrzzy authored Sep 10, 2020
1 parent e0dfb67 commit 239e191
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/master_only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ jobs:
- name: Push versioned release
run: |
# Build and push semver tagged commits
rx='^v[0-9]+?\.[0-9]+?\.[0-9]+?$'
if [[ "${RELEASE_VERSION}" =~ $rx ]]; then
# Regular expression should match MAJOR.MINOR.PATCH[-PRERELEASE[.IDENTIFIER]]
# eg. v0.7.1 v0.7.2-alpha v0.7.2-rc.1
rx='^v([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))$ '
if echo "${RELEASE_VERSION}" | grep -P "$rx" &>/dev/null ; then
VERSION_WITHOUT_PREFIX=${RELEASE_VERSION:1}
docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX}
Expand Down

0 comments on commit 239e191

Please sign in to comment.