Skip to content
This repository has been archived by the owner on Aug 25, 2024. It is now read-only.

[maven-release-plugin] prepare release vectorize-0.23.0 #56

[maven-release-plugin] prepare release vectorize-0.23.0

[maven-release-plugin] prepare release vectorize-0.23.0 #56

Workflow file for this run

name: Release
on:
push:
tags:
- 'vectorize*'
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Init maven repo
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build
run: |
chmod +x mvnw
./docker/build.sh
- name: Deploy docker images
run: |
NEW_TAG=${GITHUB_REF/refs\/tags\/vectorize-/}
IMAGE_PREFIX="langstream/langstream"
SOURCE_TAG="latest-dev"
TARGET_PREFIX="891377311292.dkr.ecr.us-east-1.amazonaws.com/vectorize"
# Login to AWS ECR
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 891377311292.dkr.ecr.us-east-1.amazonaws.com
# List and filter images, then re-tag and push them
docker images --format "{{.Repository}}:{{.Tag}}" | egrep "^${IMAGE_PREFIX}.*:${SOURCE_TAG}$" | while read -r image; do
# Extract the trailing text between prefix and tag
trailing_text=$(echo "$image" | sed "s|^${IMAGE_PREFIX}\(.*\):${SOURCE_TAG}$|\1|")
# Construct the new image name
new_image="${TARGET_PREFIX}${trailing_text}:${NEW_TAG}"
echo "Re-tagging $image to $new_image"
# Tag the image with the new name and tag
docker tag "$image" "$new_image"
# Push the image
docker push "$new_image"
done
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- uses: ncipollo/release-action@v1
with:
artifacts: "langstream-cli/target/langstream-*.zip,helm/crds/*.yml,langstream-webservice/target/api.json"
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true
prerelease: false