Skip to content

Commit e33861d

Browse files
authored
fix: templatize project name param (#88)
1 parent b2a122b commit e33861d

File tree

9 files changed

+61
-40
lines changed

9 files changed

+61
-40
lines changed

.vscode/tasks.json

+21
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,27 @@
7474
"dependsOn": ["Cleanup playground folder"],
7575
"problemMatcher": []
7676
},
77+
{
78+
"label": "Run template using algokit (template prompts, --no-workspace)",
79+
"command": "algokit",
80+
"args": [
81+
"-v",
82+
"init",
83+
"--name",
84+
"playground",
85+
"--no-git",
86+
"--UNSAFE-SECURITY-accept-template-url",
87+
"--template-url",
88+
"${workspaceFolder}",
89+
"--template-url-ref",
90+
"HEAD",
91+
"--no-bootstrap",
92+
"--no-workspace"
93+
],
94+
"type": "shell",
95+
"dependsOn": ["Cleanup playground folder"],
96+
"problemMatcher": []
97+
},
7798
{
7899
"label": "Cleanup playground folder",
79100
"command": "rm",

examples/generators/production_python_smart_contract_python/.github/workflows/production-python-smart-contract-python-cd.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: pipx install algokit
3232

3333
- name: Bootstrap dependencies
34-
run: algokit project bootstrap all --project-name 'production_python_smart_contract_python'
34+
run: algokit project bootstrap all
3535

3636
- name: Configure git
3737
shell: bash
@@ -40,7 +40,7 @@ jobs:
4040
git config --global user.email "actions@github.com" && git config --global user.name "github-actions"
4141
4242
- name: Deploy to testnet
43-
run: algokit deploy testnet --project-name 'production_python_smart_contract_python'
43+
run: algokit project deploy testnet
4444
env:
4545
# This is the account that becomes the creator of the contract
4646
DEPLOYER_MNEMONIC: ${{ secrets.DEPLOYER_MNEMONIC }}

examples/generators/production_python_smart_contract_python/.github/workflows/production-python-smart-contract-python-ci.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: algokit localnet start
2828

2929
- name: Bootstrap dependencies
30-
run: algokit project bootstrap all --project-name 'production_python_smart_contract_python'
30+
run: algokit project bootstrap all
3131

3232
- name: Configure git
3333
shell: bash
@@ -36,29 +36,29 @@ jobs:
3636
git config --global user.email "actions@github.com" && git config --global user.name "github-actions"
3737
3838
- name: Audit python dependencies
39-
run: algokit project run audit --project-name 'production_python_smart_contract_python'
39+
run: algokit project run audit
4040

4141
- name: Lint and format python dependencies
42-
run: algokit project run lint --project-name 'production_python_smart_contract_python'
42+
run: algokit project run lint
4343

4444
- name: Run tests
4545
shell: bash
4646
run: |
4747
set -o pipefail
48-
algokit project run test --project-name 'production_python_smart_contract_python'
48+
algokit project run test
4949
5050
- name: Build smart contracts
51-
run: algokit project run build --project-name 'production_python_smart_contract_python'
51+
run: algokit project run build
5252

5353
- name: Scan TEAL files for issues
54-
run: algokit project run audit-teal --project-name 'production_python_smart_contract_python'
54+
run: algokit project run audit-teal
5555

5656
# # Uncomment to enable TEAL static analysis with snapshoting using Tealer package
5757
# # Would first require running locally using audit-teal command and committing the snapshots into source control
5858
# # Please note, tealer has a known bug that may result in large snapshot file sizes, track resolution here:
5959
# # https://github.com/crytic/tealer/issues/101
6060
# - name: Check output stability of the smart contracts
61-
# run: algokit project run ci-teal-diff --project-name 'production_python_smart_contract_python'
61+
# run: algokit project run ci-teal-diff
6262

6363
- name: Run deployer against LocalNet
64-
run: algokit project deploy localnet --project-name 'production_python_smart_contract_python'
64+
run: algokit project deploy localnet

examples/generators/production_python_smart_contract_typescript/.github/workflows/production-python-smart-contract-typescript-cd.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: pipx install algokit
3232

3333
- name: Bootstrap dependencies
34-
run: algokit project bootstrap all --project-name 'production_python_smart_contract_typescript'
34+
run: algokit project bootstrap all
3535

3636
- name: Configure git
3737
shell: bash
@@ -40,7 +40,7 @@ jobs:
4040
git config --global user.email "actions@github.com" && git config --global user.name "github-actions"
4141
4242
- name: Deploy to testnet
43-
run: algokit deploy testnet --project-name 'production_python_smart_contract_typescript'
43+
run: algokit project deploy testnet
4444
env:
4545
# This is the account that becomes the creator of the contract
4646
DEPLOYER_MNEMONIC: ${{ secrets.DEPLOYER_MNEMONIC }}

examples/generators/production_python_smart_contract_typescript/.github/workflows/production-python-smart-contract-typescript-ci.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: algokit localnet start
2828

2929
- name: Bootstrap dependencies
30-
run: algokit project bootstrap all --project-name 'production_python_smart_contract_typescript'
30+
run: algokit project bootstrap all
3131

3232
- name: Configure git
3333
shell: bash
@@ -36,29 +36,29 @@ jobs:
3636
git config --global user.email "actions@github.com" && git config --global user.name "github-actions"
3737
3838
- name: Audit python dependencies
39-
run: algokit project run audit --project-name 'production_python_smart_contract_typescript'
39+
run: algokit project run audit
4040

4141
- name: Lint and format python dependencies
42-
run: algokit project run lint --project-name 'production_python_smart_contract_typescript'
42+
run: algokit project run lint
4343

4444
- name: Run tests
4545
shell: bash
4646
run: |
4747
set -o pipefail
48-
algokit project run test --project-name 'production_python_smart_contract_typescript'
48+
algokit project run test
4949
5050
- name: Build smart contracts
51-
run: algokit project run build --project-name 'production_python_smart_contract_typescript'
51+
run: algokit project run build
5252

5353
- name: Scan TEAL files for issues
54-
run: algokit project run audit-teal --project-name 'production_python_smart_contract_typescript'
54+
run: algokit project run audit-teal
5555

5656
# # Uncomment to enable TEAL static analysis with snapshoting using Tealer package
5757
# # Would first require running locally using audit-teal command and committing the snapshots into source control
5858
# # Please note, tealer has a known bug that may result in large snapshot file sizes, track resolution here:
5959
# # https://github.com/crytic/tealer/issues/101
6060
# - name: Check output stability of the smart contracts
61-
# run: algokit project run ci-teal-diff --project-name 'production_python_smart_contract_typescript'
61+
# run: algokit project run ci-teal-diff
6262

6363
- name: Run deployer against LocalNet
64-
run: algokit project deploy localnet --project-name 'production_python_smart_contract_typescript'
64+
run: algokit project deploy localnet

examples/production_python/.github/workflows/production-python-cd.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: pipx install algokit
3232

3333
- name: Bootstrap dependencies
34-
run: algokit project bootstrap all --project-name 'production_python'
34+
run: algokit project bootstrap all
3535

3636
- name: Configure git
3737
shell: bash
@@ -40,7 +40,7 @@ jobs:
4040
git config --global user.email "actions@github.com" && git config --global user.name "github-actions"
4141
4242
- name: Deploy to testnet
43-
run: algokit deploy testnet --project-name 'production_python'
43+
run: algokit project deploy testnet
4444
env:
4545
# This is the account that becomes the creator of the contract
4646
DEPLOYER_MNEMONIC: ${{ secrets.DEPLOYER_MNEMONIC }}

examples/production_python/.github/workflows/production-python-ci.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: algokit localnet start
2828

2929
- name: Bootstrap dependencies
30-
run: algokit project bootstrap all --project-name 'production_python'
30+
run: algokit project bootstrap all
3131

3232
- name: Configure git
3333
shell: bash
@@ -36,29 +36,29 @@ jobs:
3636
git config --global user.email "actions@github.com" && git config --global user.name "github-actions"
3737
3838
- name: Audit python dependencies
39-
run: algokit project run audit --project-name 'production_python'
39+
run: algokit project run audit
4040

4141
- name: Lint and format python dependencies
42-
run: algokit project run lint --project-name 'production_python'
42+
run: algokit project run lint
4343

4444
- name: Run tests
4545
shell: bash
4646
run: |
4747
set -o pipefail
48-
algokit project run test --project-name 'production_python'
48+
algokit project run test
4949
5050
- name: Build smart contracts
51-
run: algokit project run build --project-name 'production_python'
51+
run: algokit project run build
5252

5353
- name: Scan TEAL files for issues
54-
run: algokit project run audit-teal --project-name 'production_python'
54+
run: algokit project run audit-teal
5555

5656
# # Uncomment to enable TEAL static analysis with snapshoting using Tealer package
5757
# # Would first require running locally using audit-teal command and committing the snapshots into source control
5858
# # Please note, tealer has a known bug that may result in large snapshot file sizes, track resolution here:
5959
# # https://github.com/crytic/tealer/issues/101
6060
# - name: Check output stability of the smart contracts
61-
# run: algokit project run ci-teal-diff --project-name 'production_python'
61+
# run: algokit project run ci-teal-diff
6262

6363
- name: Run deployer against LocalNet
64-
run: algokit project deploy localnet --project-name 'production_python'
64+
run: algokit project deploy localnet

template_content/{% if use_github_actions %}.github{% endif %}/workflows/{% include pathjoin('includes', 'project_name_kebab.jinja') %}-cd.yaml.jinja

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: pipx install algokit
3737

3838
- name: Bootstrap dependencies
39-
run: algokit project bootstrap all --project-name '{{ project_name }}'
39+
run: algokit project bootstrap all {% if use_workspace %}--project-name '{{ project_name }}'{% endif %}
4040

4141
- name: Configure git
4242
shell: bash
@@ -45,7 +45,7 @@ jobs:
4545
git config --global user.email "actions@github.com" && git config --global user.name "github-actions"
4646

4747
- name: Deploy to testnet
48-
run: algokit deploy testnet --project-name '{{ project_name }}'
48+
run: algokit project deploy testnet {% if use_workspace %}--project-name '{{ project_name }}'{% endif %}
4949
env:
5050
{%- if use_dispenser %}
5151
# This is the account that becomes the creator of the contract

template_content/{% if use_github_actions %}.github{% endif %}/workflows/{% include pathjoin('includes', 'project_name_kebab.jinja') %}-ci.yaml.jinja

+8-8
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
run: algokit localnet start
3131

3232
- name: Bootstrap dependencies
33-
run: algokit project bootstrap all --project-name '{{ project_name }}'
33+
run: algokit project bootstrap all {% if use_workspace %}--project-name '{{ project_name }}'{% endif %}
3434

3535
- name: Configure git
3636
shell: bash
@@ -39,29 +39,29 @@ jobs:
3939
git config --global user.email "actions@github.com" && git config --global user.name "github-actions"
4040

4141
- name: Audit python dependencies
42-
run: algokit project run audit --project-name '{{ project_name }}'
42+
run: algokit project run audit {% if use_workspace %}--project-name '{{ project_name }}'{% endif %}
4343

4444
- name: Lint and format python dependencies
45-
run: algokit project run lint --project-name '{{ project_name }}'
45+
run: algokit project run lint {% if use_workspace %}--project-name '{{ project_name }}'{% endif %}
4646

4747
- name: Run tests
4848
shell: bash
4949
run: |
5050
set -o pipefail
51-
algokit project run test --project-name '{{ project_name }}'
51+
algokit project run test {% if use_workspace %}--project-name '{{ project_name }}'{% endif %}
5252

5353
- name: Build smart contracts
54-
run: algokit project run build --project-name '{{ project_name }}'
54+
run: algokit project run build {% if use_workspace %}--project-name '{{ project_name }}'{% endif %}
5555

5656
- name: Scan TEAL files for issues
57-
run: algokit project run audit-teal --project-name '{{ project_name }}'
57+
run: algokit project run audit-teal {% if use_workspace %}--project-name '{{ project_name }}'{% endif %}
5858

5959
# # Uncomment to enable TEAL static analysis with snapshoting using Tealer package
6060
# # Would first require running locally using audit-teal command and committing the snapshots into source control
6161
# # Please note, tealer has a known bug that may result in large snapshot file sizes, track resolution here:
6262
# # https://github.com/crytic/tealer/issues/101
6363
# - name: Check output stability of the smart contracts
64-
# run: algokit project run ci-teal-diff --project-name '{{ project_name }}'
64+
# run: algokit project run ci-teal-diff {% if use_workspace %}--project-name '{{ project_name }}'{% endif %}
6565

6666
- name: Run deployer against LocalNet
67-
run: algokit project deploy localnet --project-name '{{ project_name }}'
67+
run: algokit project deploy localnet {% if use_workspace %}--project-name '{{ project_name }}'{% endif %}

0 commit comments

Comments
 (0)