Skip to content

Commit 09b1c23

Browse files
Ci/all in one (#56)
* Add build-ts, npm release, and dependencies on build-ts to be successful for publishing * remove release-ts.yml workflow (added to release.yml) * fix live-run variable
1 parent ef48ccc commit 09b1c23

File tree

2 files changed

+73
-67
lines changed

2 files changed

+73
-67
lines changed

.github/workflows/release-ts.yml

-61
This file was deleted.

.github/workflows/release.yml

+73-6
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,54 @@ jobs:
6060
- name: Bump and tag project
6161
run: bash ci/scripts/bump-and-tag.bash
6262
env:
63-
LIVE_RUN: ${{ inputs.live_run }}
63+
LIVE_RUN: ${{ inputs.live-run }}
6464
VERSION: ${{ steps.create-release-branch.outputs.version }}
6565
BUMP_DEPS_VERSION: ${{ inputs.zenoh-version }}
6666
BUMP_DEPS_PATTERN: ${{ inputs.zenoh-version && 'zenoh.*' || '' }}
6767
BUMP_DEPS_BRANCH: ${{ inputs.zenoh-version && format('release/{0}', inputs.zenoh-version) || '' }}
6868
GIT_USER_NAME: eclipse-zenoh-bot
6969
GIT_USER_EMAIL: [email protected]
7070

71+
build-ts:
72+
name: Build Typescript
73+
runs-on: ubuntu-latest
74+
needs: tag
75+
steps:
76+
- name: Checkout
77+
uses: actions/checkout@v4
78+
with:
79+
ref: ${{ needs.tag.outputs.branch }}
80+
81+
- name: Install Dependencies
82+
uses: borales/actions-yarn@v4
83+
with:
84+
cmd: install
85+
dir: ./zenoh-ts
86+
87+
- name: Transpile Code
88+
working-directory: ./zenoh-ts
89+
run: |
90+
yarn run build
91+
92+
- name: Upload zenoh-ts-build
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: zenoh-ts-build
96+
include-hidden-files: true
97+
path: |
98+
zenoh-ts/dist/
99+
zenoh-ts/package.json
100+
zenoh-ts/LICENSE
101+
zenoh-ts/README.md
102+
103+
- name: Cleanup
104+
working-directory: ./zenoh-ts
105+
if: always()
106+
run: |
107+
rm -rf node_modules
108+
rm -rf dist
109+
rm -rf package-lock.json
110+
71111
build-debian:
72112
name: Build Debian packages
73113
needs: tag
@@ -91,8 +131,35 @@ jobs:
91131
^zenoh_plugin_remote_api(2)?\.dll$
92132
secrets: inherit
93133

134+
npm:
135+
name: Release Zenoh-ts to NPM
136+
runs-on: ubuntu-latest
137+
needs: [tag, build-ts]
138+
steps:
139+
- name: Download zenoh-ts-build
140+
uses: actions/download-artifact@v4
141+
with:
142+
name: zenoh-ts-build
143+
144+
- name: Publish Typescript to NPM
145+
id: publish
146+
shell: bash
147+
env:
148+
ORG_NPMJS_TOKEN: ${{ secrets.ORG_NPMJS_TOKEN }}
149+
LIVE_RUN: ${{ inputs.live-run || false }}
150+
run: |
151+
readonly live_run=${LIVE_RUN:-false}
152+
npm config set //registry.npmjs.org/:_authToken=\${ORG_NPMJS_TOKEN}
153+
if [ ${live_run} = true ]; then
154+
echo "Releasing to NPM"
155+
npm publish --access public
156+
else
157+
echo "Dry Run"
158+
npm publish --dry-run
159+
fi
160+
94161
cargo:
95-
needs: tag
162+
needs: [tag, build-standalone, build-ts]
96163
name: Publish Cargo crates
97164
uses: eclipse-zenoh/ci/.github/workflows/release-crates-cargo.yml@main
98165
with:
@@ -110,7 +177,7 @@ jobs:
110177

111178
debian:
112179
name: Publish Debian packages
113-
needs: [tag, build-debian, cargo]
180+
needs: [tag, build-debian, build-ts, cargo]
114181
uses: eclipse-zenoh/ci/.github/workflows/release-crates-debian.yml@main
115182
with:
116183
no-build: true
@@ -123,7 +190,7 @@ jobs:
123190

124191
homebrew:
125192
name: Publish Homebrew formulae
126-
needs: [tag, build-standalone, cargo]
193+
needs: [tag, build-standalone, build-ts, cargo]
127194
uses: eclipse-zenoh/ci/.github/workflows/release-crates-homebrew.yml@main
128195
with:
129196
no-build: true
@@ -139,7 +206,7 @@ jobs:
139206

140207
eclipse:
141208
name: Publish artifacts to Eclipse downloads
142-
needs: [tag, build-standalone, cargo]
209+
needs: [tag, build-standalone, build-ts, cargo]
143210
uses: eclipse-zenoh/ci/.github/workflows/release-crates-eclipse.yml@main
144211
with:
145212
no-build: true
@@ -155,7 +222,7 @@ jobs:
155222

156223
github:
157224
name: Publish artifacts to GitHub Releases
158-
needs: [tag, build-standalone, cargo]
225+
needs: [tag, build-standalone, build-ts, cargo]
159226
uses: eclipse-zenoh/ci/.github/workflows/release-crates-github.yml@main
160227
with:
161228
no-build: true

0 commit comments

Comments
 (0)