Skip to content

Commit eeb4cc4

Browse files
authored
Initial commit
0 parents  commit eeb4cc4

File tree

16 files changed

+2298
-0
lines changed

16 files changed

+2298
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
3+
{
4+
"name": "Python 3",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye",
7+
"features": {
8+
"ghcr.io/devcontainers-contrib/features/poetry:2": {}
9+
},
10+
11+
"remoteEnv": {
12+
"SPECKLE_TOKEN": "foobar"
13+
},
14+
"containerEnv": {
15+
"SPECKLE_TOKEN": "asdfasdf"
16+
},
17+
18+
// Features to add to the dev container. More info: https://containers.dev/features.
19+
// "features": {},
20+
21+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
22+
// "forwardPorts": [],
23+
24+
// Use 'postCreateCommand' to run commands after the container is created.
25+
"postCreateCommand": "cp .env.example .env && POETRY_VIRTUALENVS_IN_PROJECT=true poetry install --no-root",
26+
27+
// Configure tool-specific properties.
28+
"customizations": {
29+
"vscode": {
30+
// Add the IDs of extensions you want installed when the container is created.
31+
"extensions": [
32+
"ms-python.vscode-pylance",
33+
"ms-python.python",
34+
"ms-python.black-formatter",
35+
"streetsidesoftware.code-spell-checker",
36+
"mikestead.dotenv"
37+
]
38+
}
39+
}
40+
41+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
42+
// "remoteUser": "root"
43+
}

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SPECKLE_TOKEN=mytoken

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"

.github/workflows/main.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: 'build and deploy Speckle functions'
2+
on:
3+
workflow_dispatch:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
publish-automate-function-version: # make sure the action works on a clean machine without building
10+
env:
11+
FUNCTION_SCHEMA_FILE_NAME: functionSchema.json
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4.1.1
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.11'
18+
- name: Install and configure Poetry
19+
uses: snok/install-poetry@v1
20+
with:
21+
version: 1.3.2
22+
virtualenvs-create: false
23+
virtualenvs-in-project: false
24+
installer-parallel: true
25+
- name: Restore dependencies
26+
run: poetry install --no-root
27+
- name: Extract functionInputSchema
28+
id: extract_schema
29+
run: |
30+
python main.py generate_schema ${HOME}/${{ env.FUNCTION_SCHEMA_FILE_NAME }}
31+
- name: Speckle Automate Function - Build and Publish
32+
uses: specklesystems/speckle-automate-github-composite-action@0.8.0
33+
with:
34+
speckle_automate_url: ${{ env.SPECKLE_AUTOMATE_URL || 'https://automate.speckle.dev' }}
35+
speckle_token: ${{ secrets.SPECKLE_FUNCTION_TOKEN }}
36+
speckle_function_id: ${{ secrets.SPECKLE_FUNCTION_ID }}
37+
speckle_function_input_schema_file_path: ${{ env.FUNCTION_SCHEMA_FILE_NAME }}
38+
speckle_function_command: 'python -u main.py run'

0 commit comments

Comments
 (0)