Skip to content

Commit 671f778

Browse files
lia-viamclaudeamaschas
authored
RSDK-13622: Add lockfile to corresponding release (#608)
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com> Co-authored-by: Alexi Maschas <alexi.maschas@viam.com>
1 parent 9af24df commit 671f778

3 files changed

Lines changed: 24 additions & 28 deletions

File tree

.github/workflows/conan-publish.yml

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ on:
1212
type: boolean
1313
default: false
1414
description: If true, publish slow-building deps as well
15-
lockfile_sdk_update:
15+
lockfile_release_update:
1616
required: true
1717
type: boolean
18-
default: true
19-
description: If true, update the SDK version in the lockfile
18+
default: false
19+
description: If true, add a conan.lock artifact to the draft release
2020

2121

2222
jobs:
@@ -50,7 +50,7 @@ jobs:
5050
conan remote auth --force -cc core:non_interactive=True viamconan
5151
5252
- name: Set lockfile update arguments
53-
if: inputs.lockfile_sdk_update
53+
if: inputs.lockfile_release_update
5454
run: echo "LOCKFILE_UPDATE_ARGS=--lockfile-out conan.lock --lockfile-clean" >> $GITHUB_ENV
5555

5656
- name: Create and upload package
@@ -62,13 +62,15 @@ jobs:
6262
# more details.
6363
export BUF_CONFIG_DIR=$(mktemp -d)
6464
65+
conan lock add --requires=viam-cpp-sdk/${{ inputs.ref }}
66+
6567
conan create . --build=missing -s:a compiler.cppstd=17 -o:a "&:shared=False" \
6668
--lockfile etc/conan/conan.lock $LOCKFILE_UPDATE_ARGS
6769
6870
conan upload "viam-cpp-sdk/*" -r viamconan -c
6971
7072
- name: Upload lockfile artifact
71-
if: inputs.lockfile_sdk_update
73+
if: inputs.lockfile_release_update
7274
uses: actions/upload-artifact@v4
7375
with:
7476
name: conan-lockfile-macos-latest
@@ -156,20 +158,22 @@ jobs:
156158
conan remote auth --force -cc core:non_interactive=True viamconan
157159
158160
- name: Set lockfile update arguments
159-
if: inputs.lockfile_sdk_update
161+
if: inputs.lockfile_release_update
160162
run: echo "LOCKFILE_UPDATE_ARGS=--lockfile-out conan.lock --lockfile-clean" >> $GITHUB_ENV
161163

162164
- name: Create and upload package
163165
run: |
164166
. ./conan_venv/bin/activate
165167
168+
conan lock add --requires=viam-cpp-sdk/${{ inputs.ref }}
169+
166170
conan create . --build=missing -s:a compiler.cppstd=17 -o:a "&:shared=False" \
167171
--lockfile etc/conan/conan.lock $LOCKFILE_UPDATE_ARGS
168172
169173
conan upload "viam-cpp-sdk/*" -r viamconan -c
170174
171175
- name: Sanitize image name for artifact
172-
if: inputs.lockfile_sdk_update
176+
if: inputs.lockfile_release_update
173177
shell: bash
174178
env:
175179
IMAGE_NAME: "${{ matrix.image }}"
@@ -179,14 +183,13 @@ jobs:
179183
echo IMAGE_NAME=${IMAGE_NAME} >> $GITHUB_ENV
180184
181185
- name: Upload lockfile artifact
182-
if: inputs.lockfile_sdk_update
186+
if: inputs.lockfile_release_update
183187
uses: actions/upload-artifact@v4
184188
with:
185189
name: conan-lockfile-${{ matrix.runner }}-${{ env.IMAGE_NAME }}
186190
path: conan.lock
187191

188192
- name: Upload additional deps
189-
if: inputs.upload_deps && !(matrix.runner == 'ubuntu-large' && matrix.image == 'ubuntu:22.04')
190193
run: |
191194
. ./conan_venv/bin/activate
192195
@@ -258,7 +261,7 @@ jobs:
258261

259262
merge_lockfiles:
260263
needs: [build_macos, build_linux]
261-
if: inputs.lockfile_sdk_update
264+
if: inputs.lockfile_release_update
262265
runs-on: ubuntu-latest
263266

264267
steps:
@@ -289,19 +292,10 @@ jobs:
289292
conan lock merge $LOCKFILE_ARGS
290293
cat conan.lock
291294
292-
# Move merged lockfile to repository
293-
mv conan.lock ../etc/conan/conan.lock
294-
295-
- name: Create Pull Request
296-
uses: peter-evans/create-pull-request@v3
295+
- name: Upload merged lockfile to release
296+
uses: softprops/action-gh-release@v1
297297
with:
298-
commit-message: '[WORKFLOW] Update conan lockfile for SDK version ${{ inputs.ref }}'
299-
branch: 'workflow/update-lockfile'
300-
base: main
301-
add-paths: etc/conan/conan.lock
302-
delete-branch: true
303-
title: Automated Lockfile Update for v${{ inputs.ref }}
304-
body: This is an auto-generated PR to update the conan lockfile after publishing SDK version ${{ inputs.ref }}
305-
token: ${{ secrets.GIT_ACCESS_TOKEN }}
306-
307-
298+
tag_name: releases/v${{ inputs.ref }}
299+
files: lockfiles/conan.lock
300+
env:
301+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ jobs:
5353
ref: ${{ needs.prepare.outputs.sha }}
5454

5555
- name: Install dependencies
56-
run: choco install -y conan git
56+
shell: powershell
57+
run: |
58+
choco install -y conan git
59+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
5760
5861
- name: Create package
5962
shell: powershell
@@ -299,7 +302,7 @@ jobs:
299302
path: builds/viam-cpp-sdk-${{ matrix.platform }}.tar.gz
300303

301304
release:
302-
needs: [prepare, build_macos, build_linux_debian, build_linux_ubuntu_jammy]
305+
needs: [prepare, build_windows, build_macos, build_linux_debian, build_linux_ubuntu_jammy]
303306
if: github.repository_owner == 'viamrobotics'
304307
runs-on: ubuntu-latest
305308

etc/conan/conan.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"xtl/0.8.0#45f1f2f2e5cbff154b59a57dbd6efb55%1747056138.62",
66
"xtensor/0.26.0#929fed688e0b3e850106059bf3782e81%1755248340.339",
77
"xsimd/13.2.0#b4819b06b51041b1cd32114700adbb59%1743412135.667",
8-
"viam-cpp-sdk/0.33.1#b971157efae4557aa5a54c00e676a925%1774447979.2026496",
98
"re2/20230301#3d3c2b323893c0cb89b55d0c3b281724%1764857321.217",
109
"protobuf/5.27.0#99c5d5f87d1eea580a2234238020821b%1768401326.052",
1110
"openssl/3.6.1#2e0be4a996c7ca91feb31b7fe65117b9%1769599203.736",

0 commit comments

Comments
 (0)