Skip to content

Commit

Permalink
RONDB-769: Build ARM64 on Git tag pushes (#563)
Browse files Browse the repository at this point in the history
* Also build on Git tag pushes; check whether git tag == MYSQL Version
* Removed trailing slash for upload to repo.hops.works
  • Loading branch information
olapiv authored Nov 14, 2024
1 parent 0a2afb5 commit d08c787
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions .github/workflows/publish_rondb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
- "21.04.[0-9]+"
- "22.10.[0-9]+"
- "24.10.[0-9]+"
tags:
- "rondb-21.04.[0-9]+"
- "rondb-22.10.[0-9]+"
- "rondb-24.10.[0-9]+"

# This is important because the jobs are expensive and we don't want to wait a lot of time.
# This cancel-in-progress only works per branch, if a previous commit launched a job, a
Expand All @@ -36,6 +40,23 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- run: cat ./MYSQL_VERSION

- name: Extract Git tag
if: startsWith(github.ref, 'refs/tags/rondb-')
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/rondb-}" >> $GITHUB_ENV

- name: Verify RONDB_VERSION
if: startsWith(github.ref, 'refs/tags/rondb-')
shell: bash
run: |
source ./MYSQL_VERSION
RONDB_VERSION="$MYSQL_VERSION_MAJOR.$MYSQL_VERSION_MINOR.$MYSQL_VERSION_PATCH"
if [ "$RONDB_VERSION" != "$TAG_NAME" ]; then
echo "Error: RONDB_VERSION ($RONDB_VERSION) does not match the tag version ($TAG_NAME)"
exit 1
fi
- name: Set up SSH
run: |
mkdir -p "$HOME/.ssh"
Expand All @@ -54,8 +75,6 @@ jobs:
# Add the host key to the known_hosts file if it is not already present
grep -qxF "$REPO_PUBLIC_KEY" "$KNOWN_HOSTS_FILE" || echo "$REPO_PUBLIC_KEY" >> "$KNOWN_HOSTS_FILE"
- run: cat ./MYSQL_VERSION

- name: Build RonDB Tarball
run: |
BUILD_CORES=$(nproc)
Expand Down Expand Up @@ -96,14 +115,15 @@ jobs:
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
# Manual dispatches will only be dev tarballs
echo "This workflow was triggered via a dispatch."
user_code_path="/opt/repository/master/rondb-dev"
else
echo "This workflow was not triggered by a dispatch."
# We won't upload to repo.hops.works/master directly;
# This is handled by a cron job that checks whether the
# tarball already exists first
user_code_path="/home/$REPO_HOPSWORKS_USER/upload_area"
fi
echo "Copying $tarball to $host_user:$user_code_path/"
scp ./$tarball $host_user:$user_code_path/
echo "Copying $tarball to $host_user:$user_code_path"
scp ./$tarball $host_user:$user_code_path
# Delete the tarball after it has been uploaded
rm -f $tarball

0 comments on commit d08c787

Please sign in to comment.