Skip to content

Commit bf9ef78

Browse files
authored
[RSDK-4960] Publish workflow (#80)
1 parent aeb920b commit bf9ef78

5 files changed

Lines changed: 49 additions & 3 deletions

File tree

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
tests:
10+
uses: ./.github/workflows/test.yml
11+
publish-release:
12+
runs-on: [x64, qemu-host]
13+
container:
14+
image: ghcr.io/viamrobotics/micro-rdk-dev-env:amd64
15+
needs: tests
16+
steps:
17+
- name : Checkout main branch code
18+
uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 2
21+
- name: Build esp32 binary
22+
run: |
23+
bash -c 'export MICRO_RDK_USE_NVS=true && . "$IDF_PATH"/export.sh && . "$ESP_ROOT"/export-esp.sh && make build-esp32-with-cred-bin'
24+
cp examples/target/esp32-server-with-cred.bin micro-rdk-esp32-server.bin
25+
sha256sum micro-rdk-esp32-server.bin >> sha256sums.txt
26+
- name: Check release type
27+
id: check-tag
28+
run: |
29+
if echo ${{ github.event.ref }} | grep -Eq '^refs/tags/v.*rc[0-9]{1}$'; then
30+
echo "match=true" >> $GITHUB_OUTPUT
31+
else
32+
echo "match=false" >> $GITHUB_OUTPUT
33+
fi
34+
- name: Publish release
35+
uses: marvinpinto/action-automatic-releases@latest
36+
with:
37+
repo_token: ${{ secrets.GITHUB_TOKEN }}
38+
files: |
39+
micro-rdk-esp32-server.bin
40+
sha256sums.txt
41+
prerelease: ${{ steps.check-tag.outputs.match }}

.github/workflows/test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
name: Test
22

33
on:
4+
workflow_call:
45
workflow_dispatch:
56
pull_request:
67
branches: ['main']
78
push:
9+
branches:
10+
- '**'
11+
tags-ignore:
12+
- '**'
813

914
jobs:
1015
changes:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ canon-upload-amd64:
105105
canon-upload-arm64:
106106
docker tag $(IMAGE_BASE):arm64 $(IMAGE_BASE):arm64_$(DATE)
107107
docker push $(IMAGE_BASE):arm64
108-
docker push $(IMAGE_BASE):arm64_$(DATE)
108+
docker push $(IMAGE_BASE):arm64_$(DATE)

examples/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ async fn read_cloud_config(config: &mut Config) -> anyhow::Result<RobotConfig> {
351351
os: "esp32-build".to_string(),
352352
host: gethostname::gethostname().to_str().unwrap().to_string(),
353353
ips: vec![local_ip().unwrap().to_string()],
354-
version: "0.0.1".to_string(),
354+
version: env!("CARGO_PKG_VERSION").to_string(),
355355
git_revision: "".to_string(),
356356
platform: Some("esp32-build".to_string()),
357357
};

src/common/app_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ impl<'a> AppClient<'a> {
185185
os: "esp32".to_string(),
186186
host: "esp32".to_string(),
187187
ips: vec![self.ip.to_string()],
188-
version: "0.0.2".to_string(),
188+
version: env!("CARGO_PKG_VERSION").to_string(),
189189
git_revision: "".to_string(),
190190
platform: Some("esp32".to_string()),
191191
};

0 commit comments

Comments
 (0)