Skip to content

Release :: Build (Extended Services) #8

Release :: Build (Extended Services)

Release :: Build (Extended Services) #8

#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
name: "Release :: Build (Extended Services)"
on:
workflow_dispatch:
inputs:
dry_run:
type: boolean
required: true
description: "Dry run mode"
base_ref:
type: string
required: true
description: "Base reference for the checkout"
release_candidate_version:
type: string
required: true
description: "Release candidate version"
jitexecutor_native_macos_repository:
required: true
description: "JITExecutor native macOS artifacts repository"
jitexecutor_native_windows_repository:
required: true
description: "JITExecutor native windows artifacts repository"
env:
KIE_TOOLS_BUILD__runLinters: "false"
KIE_TOOLS_BUILD__runTests: "false"
KIE_TOOLS_BUILD__runEndToEndTests: "false"
KIE_TOOLS_BUILD__buildContainerImages: "true"
jobs:
extended_services:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-13, windows-latest]
steps:
- name: "Support longpaths (Windows only)"
if: runner.os == 'Windows'
run: git config --system core.longpaths true
- name: "Checkout @ GitHub default"
uses: actions/checkout@v3
- name: "Checkout @ Simulated squashed-merge if PR"
uses: ./.github/actions/checkout-pr
with:
ref: ${{ inputs.base_ref }}
- name: "Setup environment"
id: setup_env
uses: ./.github/actions/setup-env
- name: Setup maven settings (MacOS)
if: runner.os == 'macOS'
env:
WORKDIR_PATH: ${{ github.workspace }}
JITEXECUTOR_NATIVE_REPO: ${{ github.event.inputs.jitexecutor_native_macos_repository }}
run: |
mkdir -p ${WORKDIR_PATH}/.m2
echo "<settings>
<servers>
<server>
<id>apache.snapshots.https</id>
<username>${{ secrets.NEXUS_USER }}</username>
<password>${{ secrets.NEXUS_PW }}</password>
</server>
</servers>
<profiles>
<profile>
<id>additional_repos</id>
<repositories>
<repository>
<id>apache-kie-jitexecutor-native-staging-repository</id>
<name>Apache KIE JITExecutor Native Staging Repository</name>
<url>${JITEXECUTOR_NATIVE_REPO}</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>apache-kie-jitexecutor-native-staging-repository</id>
<name>Apache KIE JITExecutor Native Staging Repository</name>
<url>${JITEXECUTOR_NATIVE_REPO}</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>additional_repos</activeProfile>
</activeProfiles>
</settings>" > ${WORKDIR_PATH}/.m2/settings.xml
- name: Setup maven settings (Windows)
if: runner.os == 'Windows'
env:
WORKDIR_PATH: ${{ github.workspace }}
JITEXECUTOR_NATIVE_REPO: ${{ github.event.inputs.jitexecutor_native_windows_repository }}
shell: pwsh
run: |
New-Item -Name ".m2" -Path "$env:WORKDIR_PATH" -ItemType Directory
$contentToAdd = @"
<settings>
<servers>
<server>
<id>apache.snapshots.https</id>
<username>${{ secrets.NEXUS_USER }}</username>
<password>${{ secrets.NEXUS_PW }}</password>
</server>
</servers>
<profiles>
<profile>
<id>additional_repos</id>
<repositories>
<repository>
<id>apache-kie-jitexecutor-native-staging-repository</id>
<name>Apache KIE JITExecutor Native Staging Repository</name>
<url>$env:JITEXECUTOR_NATIVE_REPO</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>apache-kie-jitexecutor-native-staging-repository</id>
<name>Apache KIE JITExecutor Native Staging Repository</name>
<url>$env:JITEXECUTOR_NATIVE_REPO</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>additional_repos</activeProfile>
</activeProfiles>
</settings>
"@
Add-Content "$env:WORKDIR_PATH\.m2\settings.xml" $contentToAdd
- name: "Setup Maven settings file"
shell: bash
run: |
if [ ${{ runner.os == 'Windows' }} ]; then
SETTINGS_FILE_PATH=${{ github.workspace }}\.m2\settings.xml
else
SETTINGS_FILE_PATH=${{ github.workspace }}/.m2/settings.xml
fi
echo $SETTINGS_FILE_PATH
pnpm -r exec 'bash' '-c' 'echo --settings=test.xml >> .mvn/maven.config'
- name: "Bootstrap"
id: bootstrap
uses: ./.github/actions/bootstrap
with:
pnpm_filter_string: -F @kie-tools/extended-services...
- name: "Build"
shell: bash
run: |
pnpm ${{ steps.bootstrap.outputs.pnpm_filter_string }} build:prod
- name: Import GPG key
if: github.event_name != 'pull_request'
uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549
with:
gpg_private_key: ${{ secrets.GPG_KEY }}
- name: "Setup Extended Services for macOS x86 artifacts"
id: macos_setup_artifact
if: ${{ runner.os == 'macOS' && runner.arch != 'arm64' && !inputs.dry_run }}
shell: bash
env:
RELEASE_CANDIDATE_VERSION: ${{ inputs.release_candidate_version }}
run: |
ARTIFACT_ZIP_FILE="./extended-services-release-artifacts/incubator-kie-$RELEASE_CANDIDATE_VERSION-sandbox-extended-services-macOS-x86.zip"
echo "ARTIFACT_ZIP_FILE=$ARTIFACT_ZIP_FILE" >> "$GITHUB_OUTPUT"
mkdir ./extended-services-release-artifacts
zip $ARTIFACT_ZIP_FILE ./packages/extended-services/dist/darwin/Kogito.dmg
- name: "Sign Extended Services for macOS x86 artifact"
if: ${{ runner.os == 'macOS' && runner.arch != 'arm64' && !inputs.dry_run }}
shell: bash
env:
ARTIFACT_ZIP_FILE: ${{ steps.macos_setup_artifact.outputs.ARTIFACT_ZIP_FILE }}
run: |
gpg --no-tty --batch --sign --pinentry-mode loopback --output $ARTIFACT_ZIP_FILE.asc --detach-sig $ARTIFACT_ZIP_FILE
shasum -a 512 $ARTIFACT_ZIP_FILE > $ARTIFACT_ZIP_FILE.sha512
- name: "Upload Extended Services for macOS x86 artifact"
if: ${{ runner.os == 'macOS' && runner.arch != 'arm64' && !inputs.dry_run }}
shell: bash
env:
SVN_USERNAME: svn_dist_kie
SVN_PASSWORD: ${{ secrets.svc-dist-kie-pass }}
RELEASE_CANDIDATE_VERSION: ${{ inputs.release_candidate_version }}
ARTIFACT_ZIP_FILE: ${{ steps.macos_setup_artifact.outputs.ARTIFACT_ZIP_FILE }}
run: |
svn co --depth=empty https://dist.apache.org/repos/dist/dev/incubator/kie/$RELEASE_CANDIDATE_VERSION/ svn-kie
cp ./extended-services-release-artifacts/* svn-kie
cd svn-kie
svn add . --force
svn ci --non-interactive --no-auth-cache --username "$SVN_USERNAME" --password "$SVN_PASSWORD" -m "Apache KIE $RELEASE_CANDIDATE_VERSION Extended Services for macOS x86 artifact"
rm -rf svn-kie
- name: "Setup Extended Services for Windows artifacts"
id: windows_setup_artifact
if: ${{ runner.os == 'Windows' && !inputs.dry_run }}
shell: pwsh
env:
RELEASE_CANDIDATE_VERSION: ${{ inputs.release_candidate_version }}
run: |
ARTIFACT_ZIP_FILE="./extended-services-release-artifacts/incubator-kie-$RELEASE_CANDIDATE_VERSION-sandbox-extended-services-windows-x86.zip"
echo "ARTIFACT_ZIP_FILE=$ARTIFACT_ZIP_FILE" >> "$GITHUB_OUTPUT"
mkdir ./extended-services-release-artifacts
zip $ARTIFACT_ZIP_FILE ./packages/extended-services/dist/win32/kie_sandbox_extended_services.exe
- name: "Sign Extended Services for Windows artifact"
if: ${{ runner.os == 'Windows' && !inputs.dry_run }}
shell: pwsh
env:
ARTIFACT_ZIP_FILE: ${{ steps.windows_setup_artifact.outputs.ARTIFACT_ZIP_FILE }}
run: |
gpg --no-tty --batch --sign --pinentry-mode loopback --output $ARTIFACT_ZIP_FILE.asc --detach-sig $ARTIFACT_ZIP_FILE
shasum -a 512 $ARTIFACT_ZIP_FILE > $ARTIFACT_ZIP_FILE.sha512
- name: "Upload Extended Services for Windows artifact"
if: ${{ runner.os == 'Windows' && !inputs.dry_run }}
shell: pwsh
env:
SVN_USERNAME: svn_dist_kie
SVN_PASSWORD: ${{ secrets.svc-dist-kie-pass }}
RELEASE_CANDIDATE_VERSION: ${{ inputs.release_candidate_version }}
ARTIFACT_ZIP_FILE: ${{ steps.windows_setup_artifact.outputs.ARTIFACT_ZIP_FILE }}
run: |
svn co --depth=empty https://dist.apache.org/repos/dist/dev/incubator/kie/$RELEASE_CANDIDATE_VERSION/ svn-kie
cp ./extended-services-release-artifacts/* svn-kie
cd svn-kie
svn add . --force
svn ci --non-interactive --no-auth-cache --username "$SVN_USERNAME" --password "$SVN_PASSWORD" -m "Apache KIE $RELEASE_CANDIDATE_VERSION Extended Services for Windows artifact"
rm -rf svn-kie