Github Release #35
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: Github Release | |
on: | |
workflow_dispatch: | |
inputs: | |
build-zoo-handler: | |
description: 'Build Zoo Handler Payload' | |
required: true | |
jobs: | |
ghrelease: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jvalkeal/setup-maven@v1 | |
with: | |
maven-version: 3.8.8 | |
maven-mirror: 'https://dlcdn.apache.org/maven/maven-3/' | |
# zoo extract and ensure | |
- name: Extract Zoo Context Properties | |
uses: jvalkeal/[email protected] | |
with: | |
dispatch-handler-extract-context-properties: true | |
ensure-env: | | |
BUILD_ZOO_HANDLER_spring_cloud_deployer_version | |
BUILD_ZOO_HANDLER_spring_cloud_dataflow_ui_version | |
BUILD_ZOO_HANDLER_spring_cloud_dataflow_version | |
# tooling | |
- name: Install Tooling | |
run: | | |
curl -sSL https://github.com/cbroglie/mustache/releases/download/v1.4.0/mustache_1.4.0_linux_amd64.tar.gz | sudo tar -C /usr/local/bin/ --no-same-owner -xzv mustache | |
# release notes and gh release | |
- name: Release | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
run: | | |
# generate release notes | |
.github/workflows/generate-release-notes.sh "${{ runner.temp }}" "$BUILD_ZOO_HANDLER_spring_cloud_deployer_version" "$BUILD_ZOO_HANDLER_spring_cloud_dataflow_ui_version" "$BUILD_ZOO_HANDLER_spring_cloud_dataflow_version" | |
gh release create v$BUILD_ZOO_HANDLER_spring_cloud_dataflow_version \ | |
--draft \ | |
--title "Spring Cloud Data Flow $BUILD_ZOO_HANDLER_spring_cloud_dataflow_version" \ | |
--notes-file "${{runner.temp}}/release_notes.md" | |
# retrieve spring-cloud-dataflow-package and upload to github release | |
export PACKAGE_VERSION=${BUILD_ZOO_HANDLER_spring_cloud_dataflow_version} | |
pushd spring-cloud-dataflow-package | |
./set-package-version.sh | |
../mvnw package | |
popd | |
PACKAGE_FILE="./spring-cloud-dataflow-package/target/spring-cloud-dataflow-oss-install-${PACKAGE_VERSION}.zip" | |
gh release upload v$PACKAGE_VERSION $PACKAGE_FILE --clobber | |
# zoo success | |
- name: Notify Build Success Zoo Handler Controller | |
uses: jvalkeal/[email protected] | |
with: | |
dispatch-handler-token: ${{ secrets.SCDF_ACCESS_TOKEN }} | |
dispatch-handler-client-payload-data: > | |
{ | |
"event": "ghrelease-succeed" | |
} | |
# zoo failure | |
- name: Notify Build Failure Zoo Handler Controller | |
if: ${{ failure() }} | |
uses: jvalkeal/[email protected] | |
with: | |
dispatch-handler-token: ${{ secrets.REPO_ACCESS_TOKEN }} | |
dispatch-handler-client-payload-data: > | |
{ | |
"event": "ghrelease-failed" | |
} |