-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* bump version 1.0.2-dev * renamed package-ts * Add Bump and tag script, release zenoh-ts on version tag include bump and tag script in main release * fix syntax error * remove release plugin, and fix release-ts * change permissions ci bump script * add publish to crates.io * Add branch input, for dry run testing
- Loading branch information
1 parent
a90eb36
commit e13def4
Showing
5 changed files
with
99 additions
and
95 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,7 @@ on: | |
workflow_dispatch: | ||
push: | ||
tags: | ||
- [0-9]+.* | ||
|
||
- '[0-9]+.*' | ||
|
||
permissions: | ||
contents: read | ||
|
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,16 +38,33 @@ on: | |
jobs: | ||
tag: | ||
name: Branch, Bump & tag crates | ||
uses: eclipse-zenoh/ci/.github/workflows/branch-bump-tag-crates.yml@main | ||
with: | ||
repo: ${{ github.repository }} | ||
live-run: ${{ inputs.live-run || false }} | ||
version: ${{ inputs.version }} | ||
branch: ${{ inputs.branch }} | ||
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) || '' }} | ||
secrets: inherit | ||
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 }} | ||
version: ${{ inputs.version }} | ||
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 }} | ||
|
||
- name: Bump and tag project | ||
run: bash ci/scripts/bump-and-tag.bash | ||
env: | ||
LIVE_RUN: ${{ inputs.live_run }} | ||
VERSION: ${{ steps.create-release-branch.outputs.version }} | ||
BRANCH: ${{ inputs.branch }} | ||
GIT_USER_NAME: eclipse-zenoh-bot | ||
GIT_USER_EMAIL: [email protected] | ||
|
||
build-debian: | ||
name: Build Debian packages | ||
|
@@ -72,6 +89,23 @@ jobs: | |
^zenoh_plugin_remote_api(2)?\.dll$ | ||
secrets: inherit | ||
|
||
cargo: | ||
needs: tag | ||
name: Publish Cargo crates | ||
uses: eclipse-zenoh/ci/.github/workflows/release-crates-cargo.yml@main | ||
with: | ||
repo: ${{ github.repository }} | ||
live-run: ${{ inputs.live-run || false }} | ||
branch: ${{ needs.tag.outputs.branch }} | ||
# - In dry-run mode, we need to publish eclipse-zenoh/zenoh before this | ||
# repository, in which case the version of zenoh dependecies are left as | ||
# is and thus point to the main branch of eclipse-zenoh/zenoh. | ||
# - In live-run mode, we assume that eclipse-zenoh/zenoh is already | ||
# published as this workflow can't be responsible for publishing it | ||
unpublished-deps-patterns: ${{ !(inputs.live-run || false) && 'zenoh.*' || '' }} | ||
unpublished-deps-repos: ${{ !(inputs.live-run || false) && 'eclipse-zenoh/zenoh' || '' }} | ||
secrets: inherit | ||
|
||
debian: | ||
name: Publish Debian packages | ||
needs: [tag, build-debian] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -xeo pipefail | ||
|
||
readonly live_run=${LIVE_RUN:-false} | ||
# Release number | ||
readonly version=${VERSION:?input VERSION is required} | ||
# Release number | ||
readonly branch=${BRANCH:?input BRANCH is required} | ||
# Git actor name | ||
readonly git_user_name=${GIT_USER_NAME:?input GIT_USER_NAME is required} | ||
# Git actor email | ||
readonly git_user_email=${GIT_USER_EMAIL:?input GIT_USER_EMAIL is required} | ||
|
||
export GIT_AUTHOR_NAME=$git_user_name | ||
export GIT_AUTHOR_EMAIL=$git_user_email | ||
export GIT_COMMITTER_NAME=$git_user_name | ||
export GIT_COMMITTER_EMAIL=$git_user_email | ||
|
||
cargo +stable install toml-cli | ||
# NOTE(fuzzypixelz): toml-cli doesn't yet support in-place modification | ||
# See: https://github.com/gnprice/toml-cli?tab=readme-ov-file#writing-ish-toml-set | ||
function toml_set_in_place() { | ||
local tmp=$(mktemp) | ||
toml set "$1" "$2" "$3" > "$tmp" | ||
mv "$tmp" "$1" | ||
} | ||
|
||
package_json_path="./zenoh-ts/package.json" | ||
plugin_toml_path="./zenoh-plugin-remote-api/Cargo.toml" | ||
# Bump Cargo version of library and top level toml | ||
toml_set_in_place ${plugin_toml_path} "package.version" "$version" | ||
toml_set_in_place Cargo.toml "package.version" "$version" | ||
|
||
# Bump package.json version | ||
JQ=".version=\"$version\"" | ||
package_tmp=$(mktemp) | ||
cat ${package_json_path} | jq "$JQ" > "$package_tmp" | ||
mv ${package_tmp} ${package_json_path} | ||
|
||
git commit Cargo.toml ${plugin_toml_path} ${package_json_path} -m "chore: Bump version to $version" | ||
git push --force origin ${branch} | ||
|
||
if [[ ${live_run} ]]; then | ||
git tag --force "$version" -m "v$version" | ||
git push --force origin "$version" | ||
fi | ||
|
||
git log -10 | ||
git show-ref --tags |