Skip to content

Commit

Permalink
Merge pull request #3056 from redpanda-data/fix-ga-package-publish
Browse files Browse the repository at this point in the history
Fix ga tag pattern and add tests
  • Loading branch information
gousteris authored Dec 3, 2024
2 parents d096641 + 6d426a4 commit d303c7f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,36 @@ jobs:
with:
version: v1.61.0
args: --timeout 30m cmd/... internal/... public/...

test-push-to-cloudsmith:
if: ${{ github.repository == 'redpanda-data/connect' || github.event_name != 'schedule' }}
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v4

- name: Mock cloudsmith cli
run: |
echo '#!/bin/bash' >cloudsmith
echo "echo \$@" >>cloudsmith
chmod +x cloudsmith
mv cloudsmith /usr/local/bin/
- name: Test GA
env:
CLOUDSMITH_API_KEY: thisisatest
run: |
test $(./resources/scripts/push_pkg_to_cloudsmith.sh artifact.deb 0.0.0 \
| grep "push deb redpanda/redpanda/" | wc -l) -eq 1
test $(./resources/scripts/push_pkg_to_cloudsmith.sh artifact.deb v0.0.0 \
| grep "push deb redpanda/redpanda/" | wc -l) -eq 1
- name: Test RC
env:
CLOUDSMITH_API_KEY: thisisatest
run: |
test $(./resources/scripts/push_pkg_to_cloudsmith.sh artifact.deb 0.0.0-rc1 \
| grep "push deb redpanda/redpanda-unstable/" | wc -l) -eq 1
test $(./resources/scripts/push_pkg_to_cloudsmith.sh artifact.deb v0.0.0-rc1 \
| grep "push deb redpanda/redpanda-unstable/" | wc -l) -eq 1
2 changes: 1 addition & 1 deletion resources/scripts/push_pkg_to_cloudsmith.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ else
version=$PKG_VERSION
fi

GA_VERSION_PATTERN='^\d+\.\d+\.\d+$'
GA_VERSION_PATTERN='^[0-9]+\.[0-9]+\.[0-9]+$'
if [[ $version =~ $GA_VERSION_PATTERN ]]; then
repo="redpanda"
else
Expand Down

0 comments on commit d303c7f

Please sign in to comment.