Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
paloknapo authored Aug 30, 2023
0 parents commit 53ce407
Show file tree
Hide file tree
Showing 15 changed files with 1,648 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .devcontainer/devcontainer.json
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"
}
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SPECKLE_TOKEN=mytoken
39 changes: 39 additions & 0 deletions .github/workflows/main.yml
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'
Loading

0 comments on commit 53ce407

Please sign in to comment.