Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Automate Release #71

Merged
merged 21 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a235def
feat: Store project version in version.txt
fuzzypixelz Apr 15, 2024
8218869
fix: Remove cargo-deb metadata section in `zenoh-jni`
fuzzypixelz Apr 15, 2024
9a7eda9
feat: Add `bump-and-tag.bash` script
fuzzypixelz Apr 15, 2024
18c3add
chore: Rename release workflow to pre-release
fuzzypixelz Apr 15, 2024
a3e07ba
chore: Disable release event on publish workflows
fuzzypixelz Apr 15, 2024
687fba7
fix: Typo in ci/scripts
fuzzypixelz Apr 15, 2024
b5edfba
feat: Automate Release
fuzzypixelz Apr 15, 2024
b4423e8
chore: Remove enforce-linking-issues workflow
fuzzypixelz Apr 15, 2024
d18692d
fix: Set permissions for publishing jobs
fuzzypixelz Apr 15, 2024
952d136
feat: Add publish-dokka to release workflow
fuzzypixelz Apr 15, 2024
31db03c
fix: Set release branch in publishing jobs
fuzzypixelz Apr 15, 2024
922f21e
fix: Make `branch` input unrequired in publishing jobs
fuzzypixelz Apr 15, 2024
a8879eb
style: Uniformize publishing workflow names
fuzzypixelz Apr 15, 2024
2c84c06
fix: Unecessary use of `BOT_TOKEN_WORKFLOW`
fuzzypixelz Apr 15, 2024
35bc18c
fix: Incorrect Cargo manifest/lockfile path
fuzzypixelz Apr 15, 2024
18ea227
fix: Add missing `live-run` input for publish-dokka job
fuzzypixelz Apr 16, 2024
61c3fc9
fix: Typo in pre-release workflow name
fuzzypixelz Apr 16, 2024
c816f5b
fix: Remove `if: always()` in publish-github job
fuzzypixelz Apr 16, 2024
df828bf
fix: Remove unecessary SSH passphrase/privatekey inputs
fuzzypixelz Apr 16, 2024
49d3f0c
chore: Retrigger CI
fuzzypixelz Apr 16, 2024
e2c7235
fix: Support jq 1.6
fuzzypixelz Apr 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
name: Publish JVM snapshot package
if: github.ref == 'refs/heads/main'
needs: ci
uses: ./.github/workflows/publish_jvm.yml
uses: ./.github/workflows/publish-jvm.yml
permissions:
contents: read
packages: write
Expand All @@ -96,7 +96,7 @@ jobs:
name: Publish Android snapshot package
if: github.ref == 'refs/heads/main'
needs: ci
uses: ./.github/workflows/publish_android.yml
uses: ./.github/workflows/publish-android.yml
permissions:
contents: read
packages: write
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/enforce-linking-issues.yml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Pre-Release

on:
schedule:
- cron: "0 1 * * 1-5"
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
release:
name: Build on ${{ matrix.os }}
runs-on: ["${{ matrix.os }}"]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest]

steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11

- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26
add-to-path: false
link-to-sdk: true

- name: Install Rust toolchain
run: |
rustup show
rustup component add rustfmt clippy

- name: Cargo Format
working-directory: zenoh-jni
run: cargo fmt --all --check

- name: Clippy Check
working-directory: zenoh-jni
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Check for feature leaks
working-directory: zenoh-jni
run: cargo test --no-default-features

- name: Build Zenoh-JNI
working-directory: zenoh-jni
run: cargo build

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Gradle Test
run: gradle jvmTest --info
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Publish Android
name: Publish (Android)

on:
release:
types: [published]
workflow_call:
inputs:
snapshot:
required: true
type: boolean
description: 'If the publication is for a snapshot version.'
description: "If the publication is for a snapshot version."
default: false
branch:
description: Target branch
type: string
required: false
workflow_dispatch:

env:
Expand All @@ -24,6 +26,8 @@ jobs:
packages: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}

- uses: actions/setup-java@v3
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
name: Publish Documentation
name: Publish (Dokka)

on:
release:
types: [published]
workflow_call:
inputs:
live-run:
description: Live-run
type: boolean
required: true
branch:
description: Target branch
type: string
required: false
workflow_dispatch:

env:
Expand All @@ -14,6 +22,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}

- uses: nttld/setup-ndk@v1
id: setup-ndk
Expand All @@ -26,6 +36,7 @@ jobs:
run: gradle dokkaHtml

- name: Deploy doc
if: ${{ inputs.live-run || false }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
name: Publish JVM
name: Publish (JVM)

on:
release:
types: [published]
workflow_call:
inputs:
snapshot:
required: true
type: boolean
description: 'If the publication is for a snapshot version.'
description: "If the publication is for a snapshot version."
default: false
branch:
description: Target branch
type: string
required: false
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
JNI_LIB_PATHS: jni-libs # Edit on the inner build.gradle.kts file as well.
JNI_LIB_PATHS: jni-libs # Edit on the inner build.gradle.kts file as well.

jobs:
builds:
Expand Down Expand Up @@ -59,14 +61,16 @@ jobs:
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}

- name: Install prerequisites
shell: bash
run: |
case ${{ matrix.job.target }} in
*-linux-gnu*) cargo install cargo-deb ;;
esac

case ${{ matrix.job.target }} in
aarch64-unknown-linux-gnu)
sudo apt-get -y update
Expand All @@ -90,7 +94,7 @@ jobs:
run: |
TARGET=${{ matrix.job.target }}
MAIN_PKG_NAME="${GITHUB_WORKSPACE}/${TARGET}.zip"

case ${TARGET} in
*linux*)
cd "zenoh-jni/target/${TARGET}/release/"
Expand Down Expand Up @@ -132,6 +136,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}

- name: Create resources destination
run: mkdir ${{env.JNI_LIB_PATHS}}
Expand Down
132 changes: 86 additions & 46 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,102 @@
#
# 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:
release:
types: [published]
schedule:
- cron: "0 1 * * 1-5"
- cron: "0 0 * * 1-5"
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
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

jobs:
release:
name: Build on ${{ matrix.os }}
runs-on: [ "${{ matrix.os }}" ]
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macOS-latest ]

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:
- uses: actions/checkout@v4

- uses: actions/setup-java@v3
- id: create-release-branch
uses: eclipse-zenoh/ci/create-release-branch@main
with:
distribution: temurin
java-version: 11
repo: ${{ github.repository }}
live-run: ${{ inputs.live-run || false }}
version: ${{ inputs.version }}
github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }}

- uses: nttld/setup-ndk@v1
id: setup-ndk
- name: Checkout this repository
uses: actions/checkout@v4
with:
ndk-version: r26
add-to-path: false
link-to-sdk: true

- name: Install Rust toolchain
run: |
rustup show
rustup component add rustfmt clippy
ref: ${{ steps.create-release-branch.outputs.branch }}

- name: Cargo Format
working-directory: zenoh-jni
run: cargo fmt --all --check
- 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]

- name: Clippy Check
working-directory: zenoh-jni
run: cargo clippy --all-targets --all-features -- -D warnings
publish-jvm:
name: Publish JVM package
needs: tag
uses: ./.github/workflows/publish-jvm.yml
with:
snapshot: ${{ !(inputs.live-run || false) }}
permissions:
contents: read
packages: write

- name: Check for feature leaks
working-directory: zenoh-jni
run: cargo test --no-default-features
publish-android:
name: Publish Android package
needs: tag
uses: ./.github/workflows/publish-android.yml
with:
snapshot: ${{ !(inputs.live-run || false) }}
permissions:
contents: read
packages: write

- name: Build Zenoh-JNI
working-directory: zenoh-jni
run: cargo build
publish-dokka:
name: Publish documentation
needs: tag
uses: ./.github/workflows/publish-dokka.yml
with:
live-run: ${{ inputs.live-run || false }}

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Gradle Test
run: gradle jvmTest --info
publish-github:
needs: tag
runs-on: macos-latest
steps:
- uses: eclipse-zenoh/ci/publish-crates-github@main
with:
repo: ${{ github.repository }}
live-run: ${{ inputs.live-run || false }}
version: ${{ needs.tag.outputs.version }}
branch: ${{ needs.tag.outputs.branch }}
github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }}
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//

val zenohGroup = "io.zenoh"
val zenohVersion = "1.0.0"
val zenohVersion = file("version.txt").readText()

buildscript {
repositories {
Expand Down
Loading
Loading