Publish Artifacts #112
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Publish Artifacts" | |
on: | |
workflow_dispatch: | |
inputs: | |
module: | |
required: true | |
description: "which module to publish" | |
increment: | |
required: false | |
default: incrementMinor | |
description: "version increment (default: minor)" | |
jobs: | |
publish-and-increment: | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: write # This is required for actions/checkout | |
runs-on: ubuntu-latest | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: false | |
android: true | |
dotnet: true | |
haskell: true | |
large-packages: false | |
docker-images: true | |
swap-storage: true | |
- name: "Checkout" | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
token: ${{ secrets.TOOLS_GHA_TOKEN }} | |
- name: "Set up JDK 11" | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
# Install an older version of helm until https://github.com/helm/helm/issues/12463 is fixed | |
- name: "Set up helm" | |
uses: azure/setup-helm@v3 | |
with: | |
version: 'v3.11.3' | |
id: install | |
- name: "Login to AWS & ECR" | |
id: login-ecr-public | |
uses: ./.github/actions/aws-and-ecr-login | |
with: | |
role-session-name: github-publish-artifacts | |
aws-region: us-east-1 | |
public: "true" | |
- name: "Gradle: Build & Test, Release, Publish" | |
uses: ./.github/actions/for-module-in-group | |
with: | |
module: ${{ inputs.module }} | |
action: gradle-build-and-publish | |
OSSRH_USER: ${{ secrets.OSSRH_USER }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
# We need this to emulate other architectures for multi-platform docker builds | |
- name: "Set up QEMU for Docker" | |
uses: docker/setup-qemu-action@v2 | |
# We use the build extensions to do multi-architecture docker builds | |
- name: "Set up Docker Buildx" | |
uses: docker/setup-buildx-action@v2 | |
- name: "Publish Operator Images" | |
uses: gradle/[email protected] | |
if: ${{ inputs.module == 'operator' }} | |
with: | |
arguments: operator:pushCRD operator:pushDockerMultiArch operator:pushHelm -PdockerRegistry=${{ steps.login-ecr-public.outputs.public-registry }}/j8q9y0n6 -PhelmRegistry=${{ steps.login-ecr-public.outputs.public-registry }}/j8q9y0n6 | |
env: | |
ECR_REGISTRY: ${{ steps.login-ecr-public.outputs.public-registry }} | |
- name: "Publish Example Images" | |
uses: gradle/[email protected] | |
if: ${{ inputs.module == 'kafka-client' }} | |
with: | |
arguments: kafka-client-examples:simple-example:pushDockerMultiArch -PdockerRegistry=${{ steps.login-ecr-public.outputs.public-registry }}/j8q9y0n6 -PhelmRegistry=${{ steps.login-ecr-public.outputs.public-registry }}/j8q9y0n6 | |
env: | |
ECR_REGISTRY: ${{ steps.login-ecr-public.outputs.public-registry }} | |
- name: "Checkout sindri" | |
uses: actions/checkout@v3 | |
with: | |
repository: responsivedev/sindri | |
path: sindri | |
ref: refs/heads/main | |
token: ${{ secrets.TOOLS_GHA_TOKEN }} | |
- name: "Install Kind" | |
uses: helm/[email protected] | |
with: | |
install_only: true | |
- name: 'Login to AWS & ECR' | |
uses: ./.github/actions/aws-and-ecr-login | |
with: | |
role-session-name: github-publish-artifacts | |
aws-region: us-west-2 | |
- name: "Set Operator Version" | |
run: | | |
echo "OPERATOR_VERSION=$(./gradlew operator:cV | grep Project.version | sed 's/Project version: //')" >> $GITHUB_ENV | |
- name: "Set Kafka Client Version" | |
run: | | |
echo "KAFKA_CLIENTS_VERSION=$(./gradlew kafka-client:cV | grep Project.version | sed 's/Project version: //')" >> $GITHUB_ENV | |
- name: "Run Smoke Test (Operator)" | |
working-directory: sindri | |
if: ${{ inputs.module == 'operator' }} | |
run: | | |
./scripts/update-versions -s responsiveOperator -e local -i public.ecr.aws/j8q9y0n6/responsiveinc/responsive-operator:$OPERATOR_VERSION | |
./scripts/run-smoke-test -s release -w system-tests-pub-release | |
git checkout -- . | |
./scripts/update-versions -u -s responsiveOperator -e local -i public.ecr.aws/j8q9y0n6/responsiveinc/responsive-operator:$OPERATOR_VERSION | |
env: | |
DD_SERVICE: "https://us5.datadoghq.com/" | |
DD_API_KEY: ${{ secrets.DD_API_KEY }} | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
- name: "Run Smoke Test (Kafka Clients)" | |
working-directory: sindri | |
if: ${{ inputs.module == 'kafka-client' }} | |
run: | | |
./scripts/update-client-versions -s release -p true -i public.ecr.aws/j8q9y0n6/responsiveinc/simple-example -t $KAFKA_CLIENTS_VERSION | |
./scripts/run-smoke-test -s release -w system-tests-pub-release | |
git checkout -- . | |
./scripts/update-client-versions -u -s release -p true -i public.ecr.aws/j8q9y0n6/responsiveinc/simple-example -t $KAFKA_CLIENTS_VERSION | |
env: | |
DD_SERVICE: "https://us5.datadoghq.com/" | |
DD_API_KEY: ${{ secrets.DD_API_KEY }} | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
- name: "Create Next Version Commit" | |
run: | | |
git config --global user.name 'Responsive Tools' | |
git config --global user.email '[email protected]' | |
./gradlew :${{ inputs.module }}:markNextVersion \ | |
-Prelease.incrementer=${{ inputs.increment }} \ | |
-Prelease.dryRun | grep "Creating" | git commit --allow-empty -F - | |
git push | |
- name: "Push next platform version to Sindri" | |
working-directory: sindri | |
run: | | |
git config --global user.name 'Responsive Tools' | |
git config --global user.email '[email protected]' | |
git commit --allow-empty -am "update responsive-pub artifact versions" | |
git push | |
- name: "Increment Version" | |
uses: gradle/[email protected] | |
with: | |
arguments: :${{ inputs.module }}:markNextVersion -Prelease.incrementer=${{ inputs.increment }} |