From 2bf6c15c40afc572f244805e8abf8d5e2c5a0fed Mon Sep 17 00:00:00 2001 From: Alan Davidson Date: Fri, 7 Feb 2025 13:43:42 -0500 Subject: [PATCH 1/3] update github action for new release format --- .github/workflows/publish.yaml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 742efbe..8ee278d 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,17 +1,30 @@ # see https://github.com/viamrobotics/build-action for help on: - push: - tags: - - '[0-9]+.[0-9]+.[0-9]+' + release: + types: [published] jobs: + validate-tag: # Make sure we're publishing a tag that looks like semantic versioning + runs-on: ubuntu-latest + steps: + - name: Validate tag format + run: | + TAG="${{ github.event.release.tag_name }}" + echo "Validating tag: '$TAG'" + if [[ $TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]*)?$ ]]; then + echo "Tag matches semver." + else + echo "Error: tag does not match semver." + exit 1 + fi + publish: runs-on: ubuntu-latest + needs: [validate-tag] steps: - uses: actions/checkout@v3 - uses: viamrobotics/build-action@v1 with: - # note: you can replace this line with 'version: ""' if you want to test the build process without deploying version: ${{ github.ref_name }} ref: ${{ github.sha }} key-id: ${{ secrets.viam_key_id }} From 2940a14b0d0c7b978e29bf5f3560d460ae60f36f Mon Sep 17 00:00:00 2001 From: Alan Davidson Date: Fri, 7 Feb 2025 14:05:41 -0500 Subject: [PATCH 2/3] pr feedback: fix the version to be the tag name --- .github/workflows/publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 8ee278d..59e2007 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v3 - uses: viamrobotics/build-action@v1 with: - version: ${{ github.ref_name }} + version: ${{ github.event.release.tag_name }} ref: ${{ github.sha }} key-id: ${{ secrets.viam_key_id }} key-value: ${{ secrets.viam_key_value }} From f0a531613fe9af2a972a42a1725136c518a69513 Mon Sep 17 00:00:00 2001 From: Alan Davidson Date: Fri, 7 Feb 2025 14:12:54 -0500 Subject: [PATCH 3/3] pr feedback: bump checkout action from v3 to v4 --- .github/workflows/publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 59e2007..cec5a52 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest needs: [validate-tag] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: viamrobotics/build-action@v1 with: version: ${{ github.event.release.tag_name }}