Skip to content

bump version

bump version #44

Workflow file for this run

name: publish
on:
push:
tags:
- "v*"
jobs:
tests:
uses: ./.github/workflows/test.yml
build-installer:
strategy:
fail-fast: false
matrix:
job:
- { target: x86_64-unknown-linux-gnu, file_suffix: amd64-linux, os: ubuntu-latest}
- { target: x86_64-apple-darwin, file_suffix: macos, os: macos-latest}
- { target: x86_64-pc-windows-gnu, file_suffix: windows.exe, os: windows-latest}
runs-on: ${{ matrix.job.os }}
defaults:
run:
shell: bash
steps:
- name: Checkout main branch code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.75.0
override: true
target: ${{ matrix.job.target }}
default: true
- name: Install x86_64 linux dependencies
if: ${{ matrix.job.os == 'ubuntu-latest' }}
run: |
sudo apt-get install libudev-dev pkg-config libssl-dev
- name: Install MacOS dependencies
if: ${{ matrix.job.os == 'macos-latest' }}
run: |
brew install coreutils
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
- name: Build installer binary
run: |
cargo build -p micro-rdk-installer --release --target ${{ matrix.job.target }} --locked
- name: Rename result
if: ${{ matrix.job.os != 'windows-latest' }}
run: |
cp target/${{ matrix.job.target }}/release/micro-rdk-installer micro-rdk-installer-${{ matrix.job.file_suffix }}
- name: Rename result (Windows)
if: ${{ matrix.job.os == 'windows-latest' }}
run: |
cp target/${{ matrix.job.target }}/release/micro-rdk-installer.exe micro-rdk-installer-${{ matrix.job.file_suffix }}
- name: Check release type
id: check-tag
run: |
if echo ${{ github.event.ref }} | grep -Eq '^refs/tags/v.*rc[0-9]{1}$'; then
echo "is_rc_release=true" >> $GITHUB_OUTPUT
else
echo "is_rc_release=false" >> $GITHUB_OUTPUT
fi
- name: Upload release
uses: actions/upload-artifact@v4
with:
name: micro-rdk-installer-${{ matrix.job.file_suffix }}
path: micro-rdk-installer-${{ matrix.job.file_suffix }}
# github-actions does not have a runner that supports arm64 linux and cross-compilation does not seem to work for the ring crate
build-installer-arm64-linux:
runs-on: [buildjet-8vcpu-ubuntu-2204-arm]
container:
image: ghcr.io/viamrobotics/micro-rdk-dev-env:arm64
needs: tests
defaults:
run:
shell: bash
steps:
- name: Checkout main branch code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.75.0
override: true
target: aarch64-unknown-linux-gnu
default: true
- name: Build installer binary
run: |
cargo build -p micro-rdk-installer --release --locked --target aarch64-unknown-linux-gnu
cp target/aarch64-unknown-linux-gnu/release/micro-rdk-installer micro-rdk-installer-arm64-linux
- name: Upload release
uses: actions/upload-artifact@v4
with:
name: micro-rdk-installer-arm64-linux
path: micro-rdk-installer-arm64-linux
build-micro-RDK:
runs-on: ubuntu-latest
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 '. /home/testbot/.bash_profile ; git config --global --add safe.directory "$ESP_ROOT"/esp-idf && make build-esp32-bin && cargo +esp build -p micro-rdk-ffi --target=xtensa-esp32-espidf -Zbuild-std=std,panic_abort --locked --profile release-ffi'
cp target/xtensa-esp32-espidf/micro-rdk-server-esp32.bin micro-rdk-server-esp32.bin
cp target/xtensa-esp32-espidf/release-ffi/libmicrordk.a libmicrordk.a
cp micro-rdk-ffi/include/micrordk.h micrordk.h
- name: Upload release Lib
uses: actions/upload-artifact@v4
with:
name: micro-rdk
path: |
libmicrordk.a
micrordk.h
micro-rdk-server-esp32.bin
publish-release:
needs: [build-installer, build-installer-arm64-linux, build-micro-RDK]
runs-on: ubuntu-latest
steps:
- 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: Download arm64-linux installer
uses: actions/download-artifact@v4
with:
name: micro-rdk-installer-arm64-linux
- name: Download amd64-linux installer
uses: actions/download-artifact@v4
with:
name: micro-rdk-installer-amd64-linux
- name: Download macos installer
uses: actions/download-artifact@v4
with:
name: micro-rdk-installer-macos
- name: Download windows installer
uses: actions/download-artifact@v4
with:
name: micro-rdk-installer-windows.exe
- name: Download Micro-RDK
uses: actions/download-artifact@v4
with:
name: micro-rdk
- name: Zip FFI assets
run: |
zip micro-rdk-lib.zip libmicrordk.a micrordk.h
- name: Compute checksums
run: |
sha256sum micro-rdk-installer-arm64-linux >> sha256sums.txt
sha256sum micro-rdk-installer-amd64-linux >> sha256sums.txt
sha256sum micro-rdk-installer-macos >> sha256sums.txt
sha256sum micro-rdk-server-esp32.bin >> sha256sums.txt
sha256sum micro-rdk-installer-windows.exe >> sha256sums.txt
sha256sum micro-rdk-lib.zip >> sha256sums.txt
- name: Update CHANGELOG
id: changelog
uses: mikepenz/release-changelog-builder-action@v4
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}
ignorePreReleases: "false"
fetchViaCommits: "true"
- name: Publish release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: |
micro-rdk-installer-arm64-linux
micro-rdk-installer-amd64-linux
micro-rdk-installer-macos
micro-rdk-server-esp32.bin
micro-rdk-lib.zip
sha256sums.txt
micro-rdk-installer-windows.exe
prerelease: ${{ steps.check-tag.outputs.match }}
replacesArtifacts: true
allowUpdates: true
name: ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.changelog }}