Skip to content

release

release #302

Workflow file for this run

name: Build
on:
repository_dispatch:
types: [release]
env:
CDK_APP_NAME: Conduktor
CDK_APP_DESCRIPTION: A beautiful and fully-featured desktop client for Apache Kafka
CDK_COPYRIGHT: © 2019-2023 Conduktor Inc
CDK_VENDOR: Conduktor Inc
CDK_JLINK_MODULES: java.base,java.se,javafx.web,javafx.media,java.desktop,java.management,java.naming,java.prefs,jdk.zipfs,jdk.unsupported,jdk.unsupported.desktop,jdk.httpserver,jdk.management.agent
CDK_JAVA_OPTIONS: "-Xms128m -Xmx2048m -Dsun.io.useCanonPrefixCache=false -Djava.net.preferIPv4Stack=true -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCompressedOops -Dfile.encoding=UTF-8 -Dprism.order=sw -Dsoftware.amazon.awssdk.http.service.impl=software.amazon.awssdk.http.urlconnection.UrlConnectionSdkHttpService"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
###############################################################################
jobs:
zip-linux:
name: build conduktor.zip for linux
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: joschi/setup-jdk@v2
with:
java-version: openjdk14
- name: Fetch Conduktor sources
run: |
git clone --single-branch --branch ${{ github.event.client_payload.tag }} --depth 1 https://osef:${{secrets.GH_BUILD_TOKEN}}@github.com/conduktor/conduktor-desktop.git
- name: Gradle cache
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradlex-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradlex-
- name: Gradle wrapper cache
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-wrapperx-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-wrapperx-
- name: m2 wrapper cache
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2
- name: build conduktor.zip
env:
GH_PACKAGES_USERNAME: ${{ secrets.GH_PACKAGES_USERNAME }}
GH_PACKAGES_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
working-directory: conduktor-desktop
run: echo "version=${{ github.event.client_payload.version }}" >> gradle.properties && ./gradlew --build-cache --stacktrace distZip
- name: publish artifact
uses: actions/upload-artifact@v1
with:
name: conduktor-linux
path: "./conduktor-desktop/desktop/build/distributions/conduktor-${{ github.event.client_payload.version }}.zip"
zip-windows:
name: build conduktor.zip for windows
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: joschi/setup-jdk@v2
with:
java-version: openjdk14
- name: Fetch Conduktor sources
run: |
git clone --single-branch --branch ${{ github.event.client_payload.tag }} --depth 1 https://osef:${{secrets.GH_BUILD_TOKEN}}@github.com/conduktor/conduktor-desktop.git
- name: Gradle cache
uses: actions/cache@v1
with:
path: ~\.gradle\caches
key: ${{ runner.os }}-gradlex-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradlex-
- name: Gradle wrapper cache
uses: actions/cache@v1
with:
path: ~\.gradle\wrapper
key: ${{ runner.os }}-wrapperx-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-wrapperx-
- name: m2 wrapper cache
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2
- name: build conduktor.zip
env:
GH_PACKAGES_USERNAME: ${{ secrets.GH_PACKAGES_USERNAME }}
GH_PACKAGES_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
shell: bash
working-directory: conduktor-desktop
run: echo "version=${{ github.event.client_payload.version }}" >> gradle.properties && ./gradlew --build-cache --stacktrace distZip
- name: publish artifact
uses: actions/upload-artifact@v1
with:
name: conduktor-windows
path: "./conduktor-desktop/desktop/build/distributions/conduktor-${{ github.event.client_payload.version }}.zip"
zip-macos:
name: build conduktor.zip for macos
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: joschi/setup-jdk@v2
with:
java-version: openjdk14
- name: Fetch Conduktor sources
run: |
git clone --single-branch --branch ${{ github.event.client_payload.tag }} --depth 1 https://osef:${{secrets.GH_BUILD_TOKEN}}@github.com/conduktor/conduktor-desktop.git
- name: Clean up existing cache
run: rm -rf ~/.gradle/caches/*
- name: Gradle cache
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradlexx-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradlexx-
- name: Gradle wrapper cache
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-wrapperxx-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-wrapperxx-
- name: m2 wrapper cache
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2
- name: build conduktor.zip
env:
GH_PACKAGES_USERNAME: ${{ secrets.GH_PACKAGES_USERNAME }}
GH_PACKAGES_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
working-directory: conduktor-desktop
run: echo "version=${{ github.event.client_payload.version }}" >> gradle.properties && ./gradlew --build-cache --stacktrace distZip
- name: publish artifact
uses: actions/upload-artifact@v1
with:
name: conduktor-macos
path: "./conduktor-desktop/desktop/build/distributions/conduktor-${{ github.event.client_payload.version }}.zip"
###############################################################################
macos:
runs-on: macos-11
needs: zip-macos
steps:
- uses: actions/checkout@v2
- uses: joschi/setup-jdk@v2
with:
java-version: openjdk14
- name: Download built distribution
uses: actions/download-artifact@v1
with:
name: conduktor-macos
- name: Build macOS packages
env:
MACOS_SIGNING_IDENTITY_PASSPHRASE: ${{ secrets.MACOS_SIGNING_IDENTITY_PASSPHRASE }}
MACOS_SIGNING_IDENTITY_B64: ${{ secrets.MACOS_SIGNING_IDENTITY_B64 }}
MACOS_SIGNING_USERNAME: ${{ secrets.MACOS_SIGNING_USERNAME }}
MACOS_SIGNING_SPECIFIC_PWD: ${{ secrets.MACOS_SIGNING_SPECIFIC_PWD }}
run: |
unzip conduktor-macos/conduktor-${{ github.event.client_payload.version }}.zip
.github/scripts/macos.sh ${{ github.event.client_payload.version }}
- name: Prepare upload
run: |
mkdir -p macos
mv ${{ env.CDK_APP_NAME }}-${{ github.event.client_payload.version }}.pkg macos
#mv ${{ env.CDK_APP_NAME }}-${{ github.event.client_payload.version }}.dmg macos
- name: Upload macOS .pkg & .dmg
uses: actions/upload-artifact@v1
with:
name: macos
path: macos
###############################################################################
linux:
runs-on: ubuntu-20.04
needs: zip-linux
steps:
- uses: actions/checkout@v2
- uses: joschi/setup-jdk@v2
with:
java-version: openjdk14
- name: Download built distribution
uses: actions/download-artifact@v1
with:
name: conduktor-linux
- name: Build Linux packages
run: |
unzip conduktor-linux/conduktor-${{ github.event.client_payload.version }}.zip
.github/scripts/linux.sh ${{ github.event.client_payload.version }}
- name: Prepare upload
run: |
mkdir -p linux
mv ${{ env.CDK_APP_NAME }}-${{ github.event.client_payload.version }}.deb linux
mv ${{ env.CDK_APP_NAME }}-${{ github.event.client_payload.version }}.rpm linux
- name: Upload Linux .deb & .rpm
uses: actions/upload-artifact@v1
with:
name: linux
path: linux
###############################################################################
windows:
runs-on: windows-2019
needs: zip-windows
steps:
- uses: actions/checkout@v2
- uses: joschi/setup-jdk@v2
with:
java-version: openjdk14
- name: Download built distribution
uses: actions/download-artifact@v1
with:
name: conduktor-windows
- name: Build Windows packages
shell: bash
run: |
unzip conduktor-windows/conduktor-${{ github.event.client_payload.version }}.zip
.github/scripts/windows.sh ${{ github.event.client_payload.version }}
- name: Prepare upload
shell: bash
run: |
mkdir -p windows
mv ${{ env.CDK_APP_NAME }}-${{ github.event.client_payload.version }}.exe windows
mv ${{ env.CDK_APP_NAME }}-${{ github.event.client_payload.version }}.msi windows
mv ${{ env.CDK_APP_NAME }}-${{ github.event.client_payload.version }}-single-user.msi windows
- name: Upload Windows .msi x2 and .exe
uses: actions/upload-artifact@v1
with:
name: windows
path: windows
sign-windows:
runs-on: [self-hosted, ev-sign]
needs: windows
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v1
with:
name: windows
- run: .github\scripts\winsign-ev.ps1 ${{ github.event.client_payload.version }}
shell: powershell
- uses: actions/upload-artifact@v1
with:
name: windows
path: windows
###############################################################################
release:
name: "Prepare Github Release"
runs-on: ubuntu-20.04
needs: [linux, sign-windows, macos]
steps:
- uses: actions/checkout@v2
- name: Fetch Conduktor sources
run: |
git clone --branch ${{ github.event.client_payload.tag }} https://osef:${{secrets.GH_BUILD_TOKEN}}@github.com/conduktor/conduktor-desktop.git
- name: "Config Github release"
run: ../.github/scripts/release.sh ${{ github.event.client_payload.version }}
id: create_release_body
working-directory: conduktor-desktop
- uses: actions/download-artifact@v1
with:
name: conduktor-windows
- uses: actions/download-artifact@v1
with:
name: conduktor-macos
- uses: actions/download-artifact@v1
with:
name: conduktor-linux
- uses: actions/download-artifact@v1
with:
name: macos
- uses: actions/download-artifact@v1
with:
name: linux
- uses: actions/download-artifact@v1
with:
name: windows
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.client_payload.tag }}
release_name: ${{ steps.create_release_body.outputs.name }}
draft: false
prerelease: false
body: ${{ steps.create_release_body.outputs.body }}
- name: Upload macOS .pkg
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./macos/Conduktor-${{ github.event.client_payload.version }}.pkg
asset_name: Conduktor-${{ github.event.client_payload.version }}.pkg
asset_content_type: application/x-newton-compatible-pkg
- name: Upload Windows .msi
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows/Conduktor-${{ github.event.client_payload.version }}.msi
asset_name: Conduktor-${{ github.event.client_payload.version }}.msi
asset_content_type: application/vnd.microsoft.portable-executable
- name: Upload Windows .msi single-user
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows/Conduktor-${{ github.event.client_payload.version }}-single-user.msi
asset_name: Conduktor-${{ github.event.client_payload.version }}-single-user.msi
asset_content_type: application/vnd.microsoft.portable-executable
# - name: Upload macOS .dmg
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./macos/Conduktor-${{ github.event.client_payload.version }}.dmg
# asset_name: Conduktor-${{ github.event.client_payload.version }}.dmg
# asset_content_type: application/x-apple-diskimage
- name: Upload Windows .exe
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows/Conduktor-${{ github.event.client_payload.version }}.exe
asset_name: Conduktor-${{ github.event.client_payload.version }}.exe
asset_content_type: application/x-apple-diskimage
- name: Upload Linux .deb
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./linux/Conduktor-${{ github.event.client_payload.version }}.deb
asset_name: Conduktor-${{ github.event.client_payload.version }}.deb
asset_content_type: vnd.debian.binary-package
- name: Linux .zip
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./conduktor-linux/conduktor-${{ github.event.client_payload.version }}.zip
asset_name: Conduktor-linux-${{ github.event.client_payload.version }}.zip
asset_content_type: application/zip
- name: Windows .zip
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./conduktor-windows/conduktor-${{ github.event.client_payload.version }}.zip
asset_name: Conduktor-win-${{ github.event.client_payload.version }}.zip
asset_content_type: application/zip
- name: Upload macOS .zip
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./conduktor-macos/conduktor-${{ github.event.client_payload.version }}.zip
asset_name: Conduktor-macOS-${{ github.event.client_payload.version }}.zip
asset_content_type: application/zip
- name: Upload Linux .rpm
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./linux/Conduktor-${{ github.event.client_payload.version }}.rpm
asset_name: Conduktor-${{ github.event.client_payload.version }}.rpm
asset_content_type: application/x-redhat-package-manager
- name: Update links
run: .github/scripts/update-links.sh ${{ secrets.REBRANDLY_TOKEN }} ${{ github.event.client_payload.version }}
- name: Configure AWS
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: 'eu-west-1'
- name: Set up S3cmd cli
uses: s3-actions/[email protected]
with:
provider: aws
region: 'eu-west-1'
access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Update AWS S3 release bucket
continue-on-error: true
run: |
VERSION=${{ github.event.client_payload.version }}
echo $VERSION > latest
cat > $VERSION.md <<-EOF
${{ steps.create_release_body.outputs.bodymd }}
EOF
s3cmd get s3://cdn-conduktor-io/releases/all all
echo $VERSION >> all
s3cmd sync all s3://cdn-conduktor-io/releases/all
s3cmd sync latest s3://cdn-conduktor-io/releases/latest
s3cmd put $VERSION.md s3://cdn-conduktor-io/releases/
- name: Invalidate Cloudfront cache
continue-on-error: true
run: |
aws cloudfront create-invalidation --distribution-id "E1UH3TV7ZSXK3G" --paths "/releases*"
- name: Update website-v2
continue-on-error: true
run: |
git config --global user.email "[email protected]"
git config --global user.name "Conduktor Bot"
git clone https://unused:${{ secrets.CONDUKTOR_BOT_TOKEN }}@github.com/conduktor/conduktor.io www
cd apps/web/data/changelog/desktop
# Switch to production branch
git checkout main
VERSION=${{ github.event.client_payload.version }}
cat > $VERSION.md <<-EOF
${{ steps.create_release_body.outputs.bodymd }}
EOF
echo '-------'
echo $VERSION
cat $VERSION.md
echo '-------'
git add $VERSION.md
git commit -m "Add changelog for version $VERSION"
git push
# Switch back to staging branch, rebase and update
git checkout develop
git rebase main
git push
- name: Update the conduktor brew tap repository
continue-on-error: true
run: |
VERSION=${{ github.event.client_payload.version }}
FILENAME=./macos/Conduktor-${VERSION}.pkg
SHA=$(shasum -a 256 $FILENAME | head -c 64)
git config --global user.email "[email protected]"
git config --global user.name "Conduktor Bot"
git clone https://unused:${{ secrets.CONDUKTOR_BOT_TOKEN }}@github.com/conduktor/homebrew-brew
cd homebrew-brew/Casks/
sed -i "2s/.*/ version \"${VERSION}\"/" conduktor.rb
sed -i "3s/.*/ sha256 \"${SHA}\"/" conduktor.rb
git add conduktor.rb
git commit -m "Version updated to $VERSION"
git push
- name: Slack notification
uses: 8398a7/action-slack@v3
if: success()
continue-on-error: true
with:
status: custom
username: Conduktor Release
icon_emoji: ":muscle:"
custom_payload: |
{
"channel": "C01DRM6L2J3",
"title_link": "https://www.conduktor.io/changelog/",
"attachments": [{
color: 'good',
text: `Conduktor ${{ github.event.client_payload.version }} released! `,
}]
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}