Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
zaporter-work committed Nov 29, 2023
1 parent 9f76793 commit 9b6fb52
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 22 deletions.
57 changes: 39 additions & 18 deletions .github/workflows/testme.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,48 @@
on:
push:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: deps
run: pip install ruff
- uses: actions/checkout@v3
- name: lint
run: ruff upload.py
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: deps
run: pip install ruff
- uses: actions/checkout@v3
- name: lint
run: ruff upload.py
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: upload
uses: ./
with:
meta-path: test/meta.json
org-id: ${{ secrets.test_org_id }}
do-upload: false
key-id: ${{ secrets.viam_key_id }}
key-value: ${{ secrets.viam_key_value }}
- uses: actions/checkout@v3
- name: update-only
uses: ./
with:
meta-path: test/meta.json
do-upload: false
key-id: ${{ secrets.viam_key_id }}
key-value: ${{ secrets.viam_key_value }}
- name: upload-with-meta-path
uses: ./
with:
meta-path: test/meta.json
module-path: test/module.tar.gz
do-upload: true
platform: "linux/amd64"
version: "0.0.0-${{ github.run_id }}-${{ github.run_attempt }}"
key-id: ${{ secrets.viam_key_id }}
key-value: ${{ secrets.viam_key_value }}
- name: upload-no-meta-path
uses: ./
with:
name: upload-ci-test
org-id: ${{ secrets.test_org_id }}
module-path: test/module.tar.gz
do-upload: true
do-update: false
platform: "linux/amd64"
version: "0.0.1-${{ github.run_id }}-${{ github.run_attempt }}"
key-id: ${{ secrets.viam_key_id }}
key-value: ${{ secrets.viam_key_value }}
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ inputs:
name:
description: name of the module. only necessary if you don't provide a metadata file. (see inputs.meta-path)
org-id:
description: organization id. one of org-id or namespace are required if your meta.json doesn't use a namespace
description: organization id. one of org-id or namespace are required if you don't provide a metadata file. (see inputs.meta-path)
namespace:
description: public namespace. one of org-id or namespace are required if your meta.json doesn't use a namespace
description: public namespace. one of org-id or namespace are required if you don't provide a metadata file. (see inputs.meta-path)
key-id:
description: ID of your auth key
required: true
Expand Down
2 changes: 1 addition & 1 deletion test/meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "upload-ci-test",
"module_id": "e76d1b3b-0468-4efd-bb7f-fb1d2b352fcb:upload-ci-test",
"visibility": "private",
"url": "https://github.com/viamrobotics/upload-module",
"description": "No-op module used for the upload CI action's self-test",
Expand Down
Binary file added test/module.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def main():
subprocess.check_call([command, 'version'])
subprocess.check_call([command, 'auth', 'api-key', '--key-id', args.key_id, '--key', args.key_value])
if args.do_update:
subprocess.check_call([command, 'module', 'update', *meta_args, *org_args])
subprocess.check_call([command, 'module', 'update', *meta_args])
logging.info('ran update')
if args.do_upload:
subprocess.check_call([command, 'module', 'upload', *meta_args, *org_args, '--platform', args.platform, '--version', args.version, args.module_path])
Expand Down

0 comments on commit 9b6fb52

Please sign in to comment.