From 22e8d07167f2fd9be0d37a1d0bef5d30883fbaaa Mon Sep 17 00:00:00 2001 From: Altynbek Orumbayev Date: Thu, 12 Dec 2024 11:31:54 +0100 Subject: [PATCH] fix: templatize project name param --- .vscode/tasks.json | 21 +++++++++++++++++++ ...ction-python-smart-contract-python-cd.yaml | 4 ++-- ...ction-python-smart-contract-python-ci.yaml | 16 +++++++------- ...n-python-smart-contract-typescript-cd.yaml | 4 ++-- ...n-python-smart-contract-typescript-ci.yaml | 16 +++++++------- .../workflows/production-python-cd.yaml | 4 ++-- .../workflows/production-python-ci.yaml | 16 +++++++------- ...roject_name_kebab.jinja') %}-cd.yaml.jinja | 4 ++-- ...roject_name_kebab.jinja') %}-ci.yaml.jinja | 16 +++++++------- 9 files changed, 61 insertions(+), 40 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index b4a674e..2fff21e 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -74,6 +74,27 @@ "dependsOn": ["Cleanup playground folder"], "problemMatcher": [] }, + { + "label": "Run template using algokit (template prompts, --no-workspace)", + "command": "algokit", + "args": [ + "-v", + "init", + "--name", + "playground", + "--no-git", + "--UNSAFE-SECURITY-accept-template-url", + "--template-url", + "${workspaceFolder}", + "--template-url-ref", + "HEAD", + "--no-bootstrap", + "--no-workspace" + ], + "type": "shell", + "dependsOn": ["Cleanup playground folder"], + "problemMatcher": [] + }, { "label": "Cleanup playground folder", "command": "rm", diff --git a/examples/generators/production_python_smart_contract_python/.github/workflows/production-python-smart-contract-python-cd.yaml b/examples/generators/production_python_smart_contract_python/.github/workflows/production-python-smart-contract-python-cd.yaml index 1c6b458..2c39a1d 100644 --- a/examples/generators/production_python_smart_contract_python/.github/workflows/production-python-smart-contract-python-cd.yaml +++ b/examples/generators/production_python_smart_contract_python/.github/workflows/production-python-smart-contract-python-cd.yaml @@ -31,7 +31,7 @@ jobs: run: pipx install algokit - name: Bootstrap dependencies - run: algokit project bootstrap all --project-name 'production_python_smart_contract_python' + run: algokit project bootstrap all - name: Configure git shell: bash @@ -40,7 +40,7 @@ jobs: git config --global user.email "actions@github.com" && git config --global user.name "github-actions" - name: Deploy to testnet - run: algokit deploy testnet --project-name 'production_python_smart_contract_python' + run: algokit deploy testnet env: # This is the account that becomes the creator of the contract DEPLOYER_MNEMONIC: ${{ secrets.DEPLOYER_MNEMONIC }} diff --git a/examples/generators/production_python_smart_contract_python/.github/workflows/production-python-smart-contract-python-ci.yaml b/examples/generators/production_python_smart_contract_python/.github/workflows/production-python-smart-contract-python-ci.yaml index ce0bd08..d0fa078 100644 --- a/examples/generators/production_python_smart_contract_python/.github/workflows/production-python-smart-contract-python-ci.yaml +++ b/examples/generators/production_python_smart_contract_python/.github/workflows/production-python-smart-contract-python-ci.yaml @@ -27,7 +27,7 @@ jobs: run: algokit localnet start - name: Bootstrap dependencies - run: algokit project bootstrap all --project-name 'production_python_smart_contract_python' + run: algokit project bootstrap all - name: Configure git shell: bash @@ -36,29 +36,29 @@ jobs: git config --global user.email "actions@github.com" && git config --global user.name "github-actions" - name: Audit python dependencies - run: algokit project run audit --project-name 'production_python_smart_contract_python' + run: algokit project run audit - name: Lint and format python dependencies - run: algokit project run lint --project-name 'production_python_smart_contract_python' + run: algokit project run lint - name: Run tests shell: bash run: | set -o pipefail - algokit project run test --project-name 'production_python_smart_contract_python' + algokit project run test - name: Build smart contracts - run: algokit project run build --project-name 'production_python_smart_contract_python' + run: algokit project run build - name: Scan TEAL files for issues - run: algokit project run audit-teal --project-name 'production_python_smart_contract_python' + run: algokit project run audit-teal # # Uncomment to enable TEAL static analysis with snapshoting using Tealer package # # Would first require running locally using audit-teal command and committing the snapshots into source control # # Please note, tealer has a known bug that may result in large snapshot file sizes, track resolution here: # # https://github.com/crytic/tealer/issues/101 # - name: Check output stability of the smart contracts - # run: algokit project run ci-teal-diff --project-name 'production_python_smart_contract_python' + # run: algokit project run ci-teal-diff - name: Run deployer against LocalNet - run: algokit project deploy localnet --project-name 'production_python_smart_contract_python' + run: algokit project deploy localnet diff --git a/examples/generators/production_python_smart_contract_typescript/.github/workflows/production-python-smart-contract-typescript-cd.yaml b/examples/generators/production_python_smart_contract_typescript/.github/workflows/production-python-smart-contract-typescript-cd.yaml index 6b833a3..92d0352 100644 --- a/examples/generators/production_python_smart_contract_typescript/.github/workflows/production-python-smart-contract-typescript-cd.yaml +++ b/examples/generators/production_python_smart_contract_typescript/.github/workflows/production-python-smart-contract-typescript-cd.yaml @@ -31,7 +31,7 @@ jobs: run: pipx install algokit - name: Bootstrap dependencies - run: algokit project bootstrap all --project-name 'production_python_smart_contract_typescript' + run: algokit project bootstrap all - name: Configure git shell: bash @@ -40,7 +40,7 @@ jobs: git config --global user.email "actions@github.com" && git config --global user.name "github-actions" - name: Deploy to testnet - run: algokit deploy testnet --project-name 'production_python_smart_contract_typescript' + run: algokit deploy testnet env: # This is the account that becomes the creator of the contract DEPLOYER_MNEMONIC: ${{ secrets.DEPLOYER_MNEMONIC }} diff --git a/examples/generators/production_python_smart_contract_typescript/.github/workflows/production-python-smart-contract-typescript-ci.yaml b/examples/generators/production_python_smart_contract_typescript/.github/workflows/production-python-smart-contract-typescript-ci.yaml index 6d14b04..9a8fced 100644 --- a/examples/generators/production_python_smart_contract_typescript/.github/workflows/production-python-smart-contract-typescript-ci.yaml +++ b/examples/generators/production_python_smart_contract_typescript/.github/workflows/production-python-smart-contract-typescript-ci.yaml @@ -27,7 +27,7 @@ jobs: run: algokit localnet start - name: Bootstrap dependencies - run: algokit project bootstrap all --project-name 'production_python_smart_contract_typescript' + run: algokit project bootstrap all - name: Configure git shell: bash @@ -36,29 +36,29 @@ jobs: git config --global user.email "actions@github.com" && git config --global user.name "github-actions" - name: Audit python dependencies - run: algokit project run audit --project-name 'production_python_smart_contract_typescript' + run: algokit project run audit - name: Lint and format python dependencies - run: algokit project run lint --project-name 'production_python_smart_contract_typescript' + run: algokit project run lint - name: Run tests shell: bash run: | set -o pipefail - algokit project run test --project-name 'production_python_smart_contract_typescript' + algokit project run test - name: Build smart contracts - run: algokit project run build --project-name 'production_python_smart_contract_typescript' + run: algokit project run build - name: Scan TEAL files for issues - run: algokit project run audit-teal --project-name 'production_python_smart_contract_typescript' + run: algokit project run audit-teal # # Uncomment to enable TEAL static analysis with snapshoting using Tealer package # # Would first require running locally using audit-teal command and committing the snapshots into source control # # Please note, tealer has a known bug that may result in large snapshot file sizes, track resolution here: # # https://github.com/crytic/tealer/issues/101 # - name: Check output stability of the smart contracts - # run: algokit project run ci-teal-diff --project-name 'production_python_smart_contract_typescript' + # run: algokit project run ci-teal-diff - name: Run deployer against LocalNet - run: algokit project deploy localnet --project-name 'production_python_smart_contract_typescript' + run: algokit project deploy localnet diff --git a/examples/production_python/.github/workflows/production-python-cd.yaml b/examples/production_python/.github/workflows/production-python-cd.yaml index 68ba5ac..2b1cc19 100644 --- a/examples/production_python/.github/workflows/production-python-cd.yaml +++ b/examples/production_python/.github/workflows/production-python-cd.yaml @@ -31,7 +31,7 @@ jobs: run: pipx install algokit - name: Bootstrap dependencies - run: algokit project bootstrap all --project-name 'production_python' + run: algokit project bootstrap all - name: Configure git shell: bash @@ -40,7 +40,7 @@ jobs: git config --global user.email "actions@github.com" && git config --global user.name "github-actions" - name: Deploy to testnet - run: algokit deploy testnet --project-name 'production_python' + run: algokit deploy testnet env: # This is the account that becomes the creator of the contract DEPLOYER_MNEMONIC: ${{ secrets.DEPLOYER_MNEMONIC }} diff --git a/examples/production_python/.github/workflows/production-python-ci.yaml b/examples/production_python/.github/workflows/production-python-ci.yaml index 06d1499..ab36d81 100644 --- a/examples/production_python/.github/workflows/production-python-ci.yaml +++ b/examples/production_python/.github/workflows/production-python-ci.yaml @@ -27,7 +27,7 @@ jobs: run: algokit localnet start - name: Bootstrap dependencies - run: algokit project bootstrap all --project-name 'production_python' + run: algokit project bootstrap all - name: Configure git shell: bash @@ -36,29 +36,29 @@ jobs: git config --global user.email "actions@github.com" && git config --global user.name "github-actions" - name: Audit python dependencies - run: algokit project run audit --project-name 'production_python' + run: algokit project run audit - name: Lint and format python dependencies - run: algokit project run lint --project-name 'production_python' + run: algokit project run lint - name: Run tests shell: bash run: | set -o pipefail - algokit project run test --project-name 'production_python' + algokit project run test - name: Build smart contracts - run: algokit project run build --project-name 'production_python' + run: algokit project run build - name: Scan TEAL files for issues - run: algokit project run audit-teal --project-name 'production_python' + run: algokit project run audit-teal # # Uncomment to enable TEAL static analysis with snapshoting using Tealer package # # Would first require running locally using audit-teal command and committing the snapshots into source control # # Please note, tealer has a known bug that may result in large snapshot file sizes, track resolution here: # # https://github.com/crytic/tealer/issues/101 # - name: Check output stability of the smart contracts - # run: algokit project run ci-teal-diff --project-name 'production_python' + # run: algokit project run ci-teal-diff - name: Run deployer against LocalNet - run: algokit project deploy localnet --project-name 'production_python' + run: algokit project deploy localnet diff --git a/template_content/{% if use_github_actions %}.github{% endif %}/workflows/{% include pathjoin('includes', 'project_name_kebab.jinja') %}-cd.yaml.jinja b/template_content/{% if use_github_actions %}.github{% endif %}/workflows/{% include pathjoin('includes', 'project_name_kebab.jinja') %}-cd.yaml.jinja index cd68d24..273364c 100644 --- a/template_content/{% if use_github_actions %}.github{% endif %}/workflows/{% include pathjoin('includes', 'project_name_kebab.jinja') %}-cd.yaml.jinja +++ b/template_content/{% if use_github_actions %}.github{% endif %}/workflows/{% include pathjoin('includes', 'project_name_kebab.jinja') %}-cd.yaml.jinja @@ -36,7 +36,7 @@ jobs: run: pipx install algokit - name: Bootstrap dependencies - run: algokit project bootstrap all --project-name '{{ project_name }}' + run: algokit project bootstrap all {% if use_workspace %}--project-name '{{ project_name }}'{% endif %} - name: Configure git shell: bash @@ -45,7 +45,7 @@ jobs: git config --global user.email "actions@github.com" && git config --global user.name "github-actions" - name: Deploy to testnet - run: algokit deploy testnet --project-name '{{ project_name }}' + run: algokit deploy testnet {% if use_workspace %}--project-name '{{ project_name }}'{% endif %} env: {%- if use_dispenser %} # This is the account that becomes the creator of the contract diff --git a/template_content/{% if use_github_actions %}.github{% endif %}/workflows/{% include pathjoin('includes', 'project_name_kebab.jinja') %}-ci.yaml.jinja b/template_content/{% if use_github_actions %}.github{% endif %}/workflows/{% include pathjoin('includes', 'project_name_kebab.jinja') %}-ci.yaml.jinja index abac062..b1456de 100644 --- a/template_content/{% if use_github_actions %}.github{% endif %}/workflows/{% include pathjoin('includes', 'project_name_kebab.jinja') %}-ci.yaml.jinja +++ b/template_content/{% if use_github_actions %}.github{% endif %}/workflows/{% include pathjoin('includes', 'project_name_kebab.jinja') %}-ci.yaml.jinja @@ -30,7 +30,7 @@ jobs: run: algokit localnet start - name: Bootstrap dependencies - run: algokit project bootstrap all --project-name '{{ project_name }}' + run: algokit project bootstrap all {% if use_workspace %}--project-name '{{ project_name }}'{% endif %} - name: Configure git shell: bash @@ -39,29 +39,29 @@ jobs: git config --global user.email "actions@github.com" && git config --global user.name "github-actions" - name: Audit python dependencies - run: algokit project run audit --project-name '{{ project_name }}' + run: algokit project run audit {% if use_workspace %}--project-name '{{ project_name }}'{% endif %} - name: Lint and format python dependencies - run: algokit project run lint --project-name '{{ project_name }}' + run: algokit project run lint {% if use_workspace %}--project-name '{{ project_name }}'{% endif %} - name: Run tests shell: bash run: | set -o pipefail - algokit project run test --project-name '{{ project_name }}' + algokit project run test {% if use_workspace %}--project-name '{{ project_name }}'{% endif %} - name: Build smart contracts - run: algokit project run build --project-name '{{ project_name }}' + run: algokit project run build {% if use_workspace %}--project-name '{{ project_name }}'{% endif %} - name: Scan TEAL files for issues - run: algokit project run audit-teal --project-name '{{ project_name }}' + run: algokit project run audit-teal {% if use_workspace %}--project-name '{{ project_name }}'{% endif %} # # Uncomment to enable TEAL static analysis with snapshoting using Tealer package # # Would first require running locally using audit-teal command and committing the snapshots into source control # # Please note, tealer has a known bug that may result in large snapshot file sizes, track resolution here: # # https://github.com/crytic/tealer/issues/101 # - name: Check output stability of the smart contracts - # run: algokit project run ci-teal-diff --project-name '{{ project_name }}' + # run: algokit project run ci-teal-diff {% if use_workspace %}--project-name '{{ project_name }}'{% endif %} - name: Run deployer against LocalNet - run: algokit project deploy localnet --project-name '{{ project_name }}' + run: algokit project deploy localnet {% if use_workspace %}--project-name '{{ project_name }}'{% endif %}