Skip to content

Commit

Permalink
[RSDK-4960] Publish workflow (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
npmenard authored Sep 20, 2023
1 parent aeb920b commit bf9ef78
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 3 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: publish

on:
push:
tags:
- "v*"

jobs:
tests:
uses: ./.github/workflows/test.yml
publish-release:
runs-on: [x64, qemu-host]
container:
image: ghcr.io/viamrobotics/micro-rdk-dev-env:amd64
needs: tests
steps:
- name : Checkout main branch code
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Build esp32 binary
run: |
bash -c 'export MICRO_RDK_USE_NVS=true && . "$IDF_PATH"/export.sh && . "$ESP_ROOT"/export-esp.sh && make build-esp32-with-cred-bin'
cp examples/target/esp32-server-with-cred.bin micro-rdk-esp32-server.bin
sha256sum micro-rdk-esp32-server.bin >> sha256sums.txt
- name: Check release type
id: check-tag
run: |
if echo ${{ github.event.ref }} | grep -Eq '^refs/tags/v.*rc[0-9]{1}$'; then
echo "match=true" >> $GITHUB_OUTPUT
else
echo "match=false" >> $GITHUB_OUTPUT
fi
- name: Publish release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
files: |
micro-rdk-esp32-server.bin
sha256sums.txt
prerelease: ${{ steps.check-tag.outputs.match }}
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
name: Test

on:
workflow_call:
workflow_dispatch:
pull_request:
branches: ['main']
push:
branches:
- '**'
tags-ignore:
- '**'

jobs:
changes:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ canon-upload-amd64:
canon-upload-arm64:
docker tag $(IMAGE_BASE):arm64 $(IMAGE_BASE):arm64_$(DATE)
docker push $(IMAGE_BASE):arm64
docker push $(IMAGE_BASE):arm64_$(DATE)
docker push $(IMAGE_BASE):arm64_$(DATE)
2 changes: 1 addition & 1 deletion examples/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ async fn read_cloud_config(config: &mut Config) -> anyhow::Result<RobotConfig> {
os: "esp32-build".to_string(),
host: gethostname::gethostname().to_str().unwrap().to_string(),
ips: vec![local_ip().unwrap().to_string()],
version: "0.0.1".to_string(),
version: env!("CARGO_PKG_VERSION").to_string(),
git_revision: "".to_string(),
platform: Some("esp32-build".to_string()),
};
Expand Down
2 changes: 1 addition & 1 deletion src/common/app_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ impl<'a> AppClient<'a> {
os: "esp32".to_string(),
host: "esp32".to_string(),
ips: vec![self.ip.to_string()],
version: "0.0.2".to_string(),
version: env!("CARGO_PKG_VERSION").to_string(),
git_revision: "".to_string(),
platform: Some("esp32".to_string()),
};
Expand Down

0 comments on commit bf9ef78

Please sign in to comment.