Nightly Builds #1637
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: Nightly Builds | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
push: | |
branches: | |
- master | |
jobs: | |
ktb_docker_build: | |
if: github.repository == 'kafka-ops/julie' | |
name: Build docker image | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-buildx-action@v1 | |
- name: Set up the JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 11 | |
distribution: "temurin" | |
cache: maven | |
- name: Build with Maven | |
run: mvn -B package --file pom.xml | |
- name: copy fat jar | |
run: cp ./target/julie-ops.jar release/docker | |
- name: copy runner file | |
run: cp ./src/main/scripts/julie-ops-cli.sh release/docker | |
- name: list files (release dir) | |
run: ls -l | |
working-directory: release/docker | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Push to Docker Hub | |
uses: docker/build-push-action@v2 | |
with: | |
context: release/docker | |
file: release/docker/Dockerfile | |
push: true | |
tags: purbon/kafka-topology-builder:latest | |
package_build: | |
if: github.repository == 'kafka-ops/julie' | |
name: Build rpm/deb packages (using maven) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up the JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 11 | |
distribution: "temurin" | |
cache: maven | |
- name: Build with Maven | |
run: mvn -B package --file pom.xml | |
- name: Set up Maven Central Repository | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '11' | |
distribution: "temurin" | |
cache: maven | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
- name: Import private GPG key | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@v4 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- name: Publish package | |
run: mvn -Dgpg.passphrase="$GPG_PASSPHRASE" --batch-mode deploy | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Import public GPG Key | |
run: rpm --import release/keys/public.key | |
- name: Build the rpm | |
run: mvn rpm:rpm | |
- name: Sign rpm | |
run: | | |
rpm --define "_gpg_name ${{ steps.import_gpg.outputs.keyid }}" --addsign target/rpm/julie-ops/RPMS/noarch/*.rpm | |
rpm --checksig target/rpm/julie-ops/RPMS/noarch/*.rpm | |
env: | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
GPG_KEY_NAME: ${{ steps.import_gpg.outputs.email }} | |
- name: Sign deb | |
run: | | |
sudo apt-get install dpkg-sig -y | |
dpkg-sig -k ${{ steps.import_gpg.outputs.keyid }} --sign builder $FILE target/*.deb | |
env: | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
GPG_KEY_NAME: ${{ steps.import_gpg.outputs.email }} | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: RPM package | |
path: target/rpm/julie-ops/RPMS/noarch/*.rpm | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: DEB package | |
path: target/*.deb | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: FAT jar | |
path: target/julie-ops.jar |