generated from specklesystems/speckle_automate_python_example
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 53ce407
Showing
15 changed files
with
1,648 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/python | ||
{ | ||
"name": "Python 3", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", | ||
"features": { | ||
"ghcr.io/devcontainers-contrib/features/poetry:2": {} | ||
}, | ||
|
||
"remoteEnv": { | ||
"SPECKLE_TOKEN": "foobar" | ||
}, | ||
"containerEnv": { | ||
"SPECKLE_TOKEN": "asdfasdf" | ||
}, | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "cp .env.example .env && POETRY_VIRTUALENVS_IN_PROJECT=true poetry install --no-root", | ||
|
||
// Configure tool-specific properties. | ||
"customizations": { | ||
"vscode": { | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"ms-python.vscode-pylance", | ||
"ms-python.python", | ||
"ms-python.black-formatter", | ||
"streetsidesoftware.code-spell-checker", | ||
"mikestead.dotenv" | ||
] | ||
} | ||
} | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SPECKLE_TOKEN=mytoken |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: 'build and deploy Speckle functions' | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
publish-automate-function-version: # make sure the action works on a clean machine without building | ||
env: | ||
FUNCTION_SCHEMA_FILE_NAME: functionSchema.json | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Install and configure Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.3.2 | ||
virtualenvs-create: false | ||
virtualenvs-in-project: false | ||
installer-parallel: true | ||
- name: Restore dependencies | ||
run: poetry install --no-root | ||
- name: Extract functionInputSchema | ||
id: extract_schema | ||
run: | | ||
echo $(python schema_generation.py) > ${HOME}/${{ env.FUNCTION_SCHEMA_FILE_NAME }} | ||
- name: Speckle Automate Function - Build and Publish | ||
uses: specklesystems/[email protected] | ||
with: | ||
speckle_automate_url: 'https://automate.speckle.dev' | ||
speckle_token: ${{ secrets.SPECKLE_FUNCTION_TOKEN }} | ||
speckle_function_id: ${{ secrets.SPECKLE_FUNCTION_ID }} | ||
speckle_function_input_schema_file_path: ${{ env.FUNCTION_SCHEMA_FILE_NAME }} | ||
speckle_function_command: 'python main.py' |
Oops, something went wrong.