Release #887
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
# | |
# Copyright (c) 2022 ZettaScale Technology | |
# | |
# This program and the accompanying materials are made available under the | |
# terms of the Eclipse Public License 2.0 which is available at | |
# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | |
# which is available at https://www.apache.org/licenses/LICENSE-2.0. | |
# | |
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | |
# | |
# Contributors: | |
# ZettaScale Zenoh Team, <[email protected]> | |
# | |
name: Release | |
on: | |
schedule: | |
- cron: "0 0 * * 1-5" | |
workflow_dispatch: | |
inputs: | |
live-run: | |
type: boolean | |
description: Live-run | |
required: false | |
version: | |
type: string | |
description: Release number | |
required: false | |
zenoh-version: | |
type: string | |
description: Release number of Zenoh | |
required: false | |
branch: | |
type: string | |
description: Release branch | |
required: false | |
jobs: | |
tag: | |
name: Branch, Bump & tag | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.create-release-branch.outputs.version }} | |
branch: ${{ steps.create-release-branch.outputs.branch }} | |
steps: | |
- id: create-release-branch | |
uses: eclipse-zenoh/ci/create-release-branch@main | |
with: | |
repo: ${{ github.repository }} | |
live-run: ${{ inputs.live-run || false }} | |
# NOTE(fuzzypixelz): When the version is undefined (e.g. on schedule | |
# events) we cannot use git-describe as CMake doesn't support it. | |
# However, we still need some placeholder version to test that the | |
# version can be reliably bumped. | |
version: ${{ inputs.version || '0.0.0' }} | |
branch: ${{ inputs.branch }} | |
github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }} | |
- name: Checkout this repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ steps.create-release-branch.outputs.branch }} | |
token: ${{ secrets.BOT_TOKEN_WORKFLOW }} | |
- name: Bump and tag project | |
run: bash ci/scripts/bump-and-tag.bash | |
env: | |
VERSION: ${{ steps.create-release-branch.outputs.version }} | |
BUMP_DEPS_VERSION: ${{ inputs.zenoh-version }} | |
BUMP_DEPS_PATTERN: ${{ inputs.zenoh-version && 'zenoh.*' || '' }} | |
BUMP_DEPS_BRANCH: ${{ inputs.zenoh-version && format('release/{0}', inputs.zenoh-version) || '' }} | |
GIT_USER_NAME: eclipse-zenoh-bot | |
GIT_USER_EMAIL: [email protected] | |
build: | |
name: Build packages | |
runs-on: ${{ matrix.build.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
build: | |
- { target: x86_64-unknown-linux-gnu, os: ubuntu-20.04 } | |
- { target: x86_64-unknown-linux-musl, os: ubuntu-20.04 } | |
- { target: arm-unknown-linux-gnueabi, os: ubuntu-20.04 } | |
- { target: arm-unknown-linux-gnueabihf, os: ubuntu-20.04 } | |
- { target: armv7-unknown-linux-gnueabihf, os: macos-14 } | |
- { target: aarch64-unknown-linux-gnu, os: ubuntu-20.04 } | |
- { target: aarch64-unknown-linux-musl, os: ubuntu-20.04 } | |
- { target: x86_64-apple-darwin, os: macos-14 } | |
- { target: aarch64-apple-darwin, os: macos-14 } | |
- { target: x86_64-pc-windows-msvc, os: windows-2019 } | |
- { target: x86_64-pc-windows-gnu, os: ubuntu-20.04 } | |
needs: tag | |
steps: | |
- name: Checkout this repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ needs.tag.outputs.branch }} | |
token: ${{ secrets.BOT_TOKEN_WORKFLOW }} | |
- name: Add rust toolchain | |
run: | | |
rustup target add ${{ matrix.build.target }} | |
- name: Install build deps | |
if: ${{ matrix.build.target == 'x86_64-unknown-linux-musl'}} | |
run: | | |
sudo apt-get install -y musl-tools | |
wget https://musl.cc/x86_64-linux-musl-cross.tgz | |
tar xvfz x86_64-linux-musl-cross.tgz | |
echo "$(readlink -f x86_64-linux-musl-cross)/bin" >> "$GITHUB_PATH" | |
- name: Install build deps | |
if: ${{ matrix.build.target == 'arm-unknown-linux-gnueabi'}} | |
run: sudo apt-get install -y gcc-arm-linux-gnueabi g++-arm-linux-gnueabi | |
- name: Install build deps | |
if: ${{ matrix.build.target == 'arm-unknown-linux-gnueabihf'}} | |
run: sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf | |
- name: Install build deps | |
if: ${{ matrix.build.target == 'armv7-unknown-linux-gnueabihf'}} | |
run: | | |
brew install -f messense/macos-cross-toolchains/armv7-unknown-linux-gnueabihf | |
brew install dpkg | |
brew install rpm | |
- name: Install build deps | |
if: ${{ matrix.build.target == 'aarch64-unknown-linux-gnu'}} | |
run: sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu | |
- name: Install build deps | |
if: ${{ matrix.build.target == 'aarch64-unknown-linux-musl'}} | |
run: | | |
wget https://musl.cc/aarch64-linux-musl-cross.tgz | |
tar xvfz aarch64-linux-musl-cross.tgz | |
echo "$(readlink -f aarch64-linux-musl-cross)/bin" >> "$GITHUB_PATH" | |
- name: Install build deps | |
if: ${{ matrix.build.target == 'x86_64-pc-windows-gnu'}} | |
run: | | |
sudo apt-get install -y mingw-w64 | |
- name: Build standalone | |
id: build | |
shell: bash | |
run: | | |
toolchain_file=$(readlink -f ci/toolchains/TC-${{ matrix.build.target }}.cmake) | |
mkdir -p build && cd build | |
cmake .. -DZENOHC_CUSTOM_TARGET=${{ matrix.build.target }} -DCMAKE_TOOLCHAIN_FILE="${toolchain_file}" -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DZENOHC_BUILD_WITH_UNSTABLE_API=ON -DZENOHC_BUILD_WITH_SHARED_MEMORY=ON | |
cmake --build . --config Release | |
cpack -C Release -G ZIP | |
- name: Build distro packages (DEB/RPM) | |
id: build-distro-packages | |
if: ${{ contains(matrix.build.target, 'linux') }} | |
run: | | |
cd build | |
cpack -G DEB | |
cpack -G RPM | |
# Download artifacts client unzips the archive when it downloads, so we double zip, to fulfill expectation of the publish-* actions | |
- name: Zip standalone archives | |
shell: bash | |
run: | | |
zip_cmd="zip -9" | |
if [[ ${{ contains(matrix.build.target, 'windows') }} == true ]]; then | |
zip_cmd="7z -mx9 a" | |
fi | |
${zip_cmd} zenohc-${{ inputs.version || '0.0.0' }}-${{ matrix.build.target }}-standalone.zip ./build/packages/*.zip | |
- name: Zip deb/rpm archives | |
shell: bash | |
if: ${{ contains(matrix.build.target, 'linux') }} | |
run: | | |
zip -9 libzenohc-${{ inputs.version || '0.0.0' }}-${{ matrix.build.target }}-debian.zip ./build/packages/*.deb | |
zip -9 libzenohc-${{ inputs.version || '0.0.0' }}-${{ matrix.build.target }}-rpm.zip ./build/packages/*.rpm | |
- name: Upload library archive | |
uses: actions/upload-artifact@v4 | |
with: | |
name: zenohc-${{ inputs.version || '0.0.0' }}-${{ matrix.build.target }}-standalone.zip | |
path: zenohc-${{ inputs.version || '0.0.0' }}-${{ matrix.build.target }}-standalone.zip | |
- name: Upload DEB archive | |
if: ${{ contains(matrix.build.target, 'linux') }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: libzenohc-${{ inputs.version || '0.0.0' }}-${{ matrix.build.target }}-debian.zip | |
path: libzenohc-${{ inputs.version || '0.0.0' }}-${{ matrix.build.target }}-debian.zip | |
- name: Upload RPM archive | |
if: ${{ contains(matrix.build.target, 'linux') }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: libzenohc-${{ inputs.version || '0.0.0' }}-${{ matrix.build.target }}-rpm.zip | |
path: libzenohc-${{ inputs.version || '0.0.0' }}-${{ matrix.build.target }}-rpm.zip | |
debian: | |
name: Publish Debian packages | |
needs: [tag, build] | |
uses: eclipse-zenoh/ci/.github/workflows/release-crates-debian.yml@main | |
with: | |
no-build: true | |
live-run: ${{ inputs.live-run || false }} | |
version: ${{ needs.tag.outputs.version }} | |
repo: ${{ github.repository }} | |
branch: ${{ needs.tag.outputs.branch }} | |
installation-test: false | |
secrets: inherit | |
homebrew: | |
name: Publish Homebrew formulae | |
needs: [tag, build] | |
uses: eclipse-zenoh/ci/.github/workflows/release-crates-homebrew.yml@main | |
with: | |
no-build: true | |
repo: ${{ github.repository }} | |
live-run: ${{ inputs.live-run || false }} | |
version: ${{ needs.tag.outputs.version }} | |
branch: ${{ needs.tag.outputs.branch }} | |
artifact-patterns: | | |
^libzenohc\.dylib$ | |
^include$ | |
formulae: | | |
libzenohc | |
secrets: inherit | |
eclipse: | |
name: Publish artifacts to Eclipse downloads | |
needs: [tag, build] | |
uses: eclipse-zenoh/ci/.github/workflows/release-crates-eclipse.yml@main | |
with: | |
no-build: true | |
live-run: ${{ inputs.live-run || false }} | |
version: ${{ needs.tag.outputs.version }} | |
repo: ${{ github.repository }} | |
branch: ${{ needs.tag.outputs.branch }} | |
artifact-patterns: | | |
^libzenohc\.(dylib|so)$ | |
^zenohc\.dll$ | |
^include$ | |
name: zenoh-c | |
secrets: inherit | |
github: | |
name: Publish artifacts to GitHub Releases | |
needs: [tag, build] | |
uses: eclipse-zenoh/ci/.github/workflows/release-crates-github.yml@main | |
with: | |
no-build: true | |
live-run: ${{ inputs.live-run || false }} | |
version: ${{ needs.tag.outputs.version }} | |
repo: ${{ github.repository }} | |
branch: ${{ needs.tag.outputs.branch }} | |
artifact-patterns: | | |
^libzenohc\.(dylib|so)$ | |
^zenohc\.dll$ | |
^include$ | |
secrets: inherit |