Skip to content

v0.4.0-rc.0

v0.4.0-rc.0 #38

Workflow file for this run

name: NPM Publish
on:
release:
types: [published]
secrets:
NPM_TOKEN:
required: true
jobs:
publish:
if: github.repository_owner == 'viamrobotics'
runs-on: [self-hosted, x64]
container:
image: ghcr.io/viamrobotics/canon:amd64
steps:
- name: Check if organization member
id: is_organization_member
if: github.event_name == 'workflow_dispatch'
uses: jamessingleton/[email protected]
with:
organization: viamrobotics
username: ${{ github.actor }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Cancelling - not an organization member
uses: andymckay/[email protected]
if: |
github.event_name == 'workflow_dispatch' && steps.is_organization_member.outputs.result == 'false'
- name: Download Release
uses: dsaltares/fetch-gh-release-asset@master
with:
file: "viamrobotics\\-sdk\\-.*\\.tgz"
regex: true
target: './'
version: tags/${{ github.event.release.tag_name }}
- name: Check Files
id: release_file
run: echo "path=$(ls -1 | head -1)" >> $GITHUB_OUTPUT
- name: Which Tag
id: which_tag
shell: bash
run: |
if ${{ contains(github.event.release.tag_name, 'rc') }} ; then
echo "tag=rc" >> $GITHUB_OUTPUT
else
echo "tag=latest" >> $GITHUB_OUTPUT
fi
- name: Publish
uses: JS-DevTools/npm-publish@v2
with:
token: ${{ secrets.NPM_TOKEN }}
tag: ${{ steps.which_tag.outputs.tag }}
package: ${{ steps.release_file.outputs.path }}