From e0d3e01909ab4281806f9c8e709d8d2b60b60877 Mon Sep 17 00:00:00 2001 From: Guillaume Beuzeboc Date: Fri, 20 Jan 2023 07:29:25 +0100 Subject: [PATCH] Fix/snap version (#162) * fix(snap): grade and version should be from the part * CI(snap): need git history for latest git tag * ci(snap): use new action-publish crendential system * ignore snap --- .github/workflows/snap.yaml | 6 +++++- .gitignore | 4 ++++ snap/snapcraft.yaml | 5 ++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/snap.yaml b/.github/workflows/snap.yaml index f590274..284b174 100644 --- a/.github/workflows/snap.yaml +++ b/.github/workflows/snap.yaml @@ -17,6 +17,9 @@ jobs: snap-file: ${{ steps.build-snap.outputs.snap }} steps: - uses: actions/checkout@v2 + with: + # full history for latest tag name + fetch-depth: 0 - uses: snapcore/action-build@v1 id: build-snap with: @@ -44,7 +47,8 @@ jobs: name: micro-ros-agent-snap path: . - uses: snapcore/action-publish@v1 + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }} with: - store_login: ${{ secrets.STORE_LOGIN }} snap: ${{needs.build.outputs.snap-file}} release: ${{ startsWith(github.ref, 'refs/tags/') && 'candidate' || 'edge'}} diff --git a/.gitignore b/.gitignore index 49d5580..58bfd9d 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,7 @@ # End of https://www.gitignore.io/api/qtcreator CMakeLists.txt.user + + +# snaps +*.snap diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 8adeb60..c713ccd 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,6 +1,6 @@ name: micro-ros-agent +adopt-info: uros-agent # parse metadata from the uros-agent part base: core20 -version: git summary: Bridge between Micro ROS client applications and ROS 2 description: | Micro-ROS, whose default implementation is based on eProsima's @@ -99,7 +99,6 @@ description: | After this, you can execute your snap as usual, using `sudo micro-ros-agent serial -d `. -grade: stable confinement: strict architectures: @@ -123,7 +122,7 @@ parts: snapcraftctl set-version "$version" snapcraftctl set-grade "$grade" - build-packages: [make, gcc, g++] + build-packages: [make, gcc, g++, git] stage-packages: [ros-foxy-ros2launch] runner: