Skip to content

Release

Release #854

Workflow file for this run

#
# 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: ubuntu-20.04 }
- { 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-12 }
- { target: aarch64-apple-darwin, os: macos-12 }
- { target: x86_64-pc-windows-msvc, os: windows-2019 }
- { target: x86_64-pc-windows-gnu, os: windows-2019 }
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
- name: Install build deps
if: ${{ matrix.build.target == 'arm-unknown-linux-gnueabi'}}
run: sudo apt-get install -y gcc-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
- name: Install build deps
if: ${{ matrix.build.target == 'armv7-unknown-linux-gnueabihf'}}
run: sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-armhf-cross libc6-dev-armhf-cross
- name: Install build deps
if: ${{ matrix.build.target == 'aarch64-unknown-linux-gnu'}}
run: sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Install build deps
if: ${{ matrix.build.target == 'aarch64-unknown-linux-musl'}}
run: sudo apt-get install -y musl-tools
# FIXME: not sure what deps are missing on windows
#- name: Install build deps
# if: ${{ matrix.build.target == 'x86_64-pc-windows-msvc'}}
# run: apt install -y
#- name: Install build deps
# if: ${{ matrix.build.target == 'x86_64-pc-windows-gnu'}}
# run: apt install -y
- id: build
run: |
mkdir -p build && cd build
cmake .. -DZENOHC_CUSTOM_TARGET=${{ matrix.build.target }} -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
- id: build-distro-packages
if: ${{ matrix.build.os == 'ubuntu-20.04' }}
run: |
cd build
cpack -G DEB
cpack -G RPM
- name: Upload library archive
uses: actions/upload-artifact@v4
with:
name: zenohc-${{ inputs.version }}-${{ matrix.build.target }}-standalone.zip
path: ./build/packages/*.zip
- name: Upload DEB archive
if: ${{ matrix.build.os == 'ubuntu-20.04' }}
uses: actions/upload-artifact@v4
with:
name: libzenohc-${{ inputs.version }}-${{ matrix.build.target }}-debian.zip
path: ./build/packages/*.deb
- name: Upload RPM archive
if: ${{ matrix.build.os == 'ubuntu-20.04' }}
uses: actions/upload-artifact@v4
with:
name: libzenohc-${{ inputs.version }}-${{ matrix.build.target }}-rpm.zip
path: ./build/packages/*.rpm
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