Skip to content

Commit

Permalink
chore: updating examples for puya and react only for now
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev committed Mar 8, 2024
1 parent 74e4c32 commit 9dd225d
Show file tree
Hide file tree
Showing 109 changed files with 436 additions and 423 deletions.
3 changes: 3 additions & 0 deletions examples/production_puya_react/.algokit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ min_version = "v1.12.0"
[project]
type = 'workspace'
projects_root_path = 'projects'

[project.run]
build = ['production_puya_react-contracts', 'production_puya_react-frontend']
1 change: 1 addition & 0 deletions examples/production_puya_react/.copier-answers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ _commit: <commit>
_src_path: <src>
author_email: None
author_name: None
cloud_provider: netlify
contract_name: hello_world
deployment_language: python
preset_name: production
Expand Down
60 changes: 0 additions & 60 deletions examples/production_puya_react/.github/workflows/frontend-cd.yaml

This file was deleted.

63 changes: 0 additions & 63 deletions examples/production_puya_react/.github/workflows/frontend-ci.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions examples/production_puya_react/.github/workflows/pr.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
name: Backend CD
name: Release production_puya_react-contracts

on:
workflow_call:

concurrency: release

jobs:
ci-check:
name: Perform smart contract checks
uses: ./.github/workflows/smart-contracts-ci.yaml

deploy-testnet:
runs-on: 'ubuntu-latest'
needs: ci-check
environment: Test
runs-on: "ubuntu-latest"

environment: contract-testnet
steps:
- name: Checkout source code
uses: actions/checkout@v4
Expand All @@ -24,26 +18,23 @@ jobs:
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'poetry'
python-version: "3.12"
cache: "poetry"

- name: Install algokit
run: pipx install algokit
run: pipx install git+https://github.com/algorandfoundation/algokit-cli@feat/orchestration-linking

- name: Bootstrap dependencies
working-directory: ./projects/production_puya_react-contracts
run: algokit bootstrap all
run: algokit bootstrap all --project-name 'production_puya_react-contracts'

- name: Configure git
shell: bash
working-directory: ./projects/production_puya_react-contracts
run: |
# set git user and email as test invoke git
git config --global user.email "[email protected]" && git config --global user.name "github-actions"
- name: Deploy to testnet
working-directory: ./projects/production_puya_react-contracts
run: algokit deploy testnet
run: algokit deploy testnet --project-name 'production_puya_react-contracts'
env:
# This is the account that becomes the creator of the contract
DEPLOYER_MNEMONIC: ${{ secrets.DEPLOYER_MNEMONIC }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Validate production_puya_react-contracts

on:
workflow_call:

jobs:
validate:
runs-on: "ubuntu-latest"
steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "poetry"

- name: Install algokit
run: pipx install git+https://github.com/algorandfoundation/algokit-cli@feat/orchestration-linking

- name: Start LocalNet
run: algokit localnet start

- name: Bootstrap dependencies
run: algokit bootstrap all --project-name 'production_puya_react-contracts'

- name: Configure git
shell: bash
run: |
# set git user and email as test invoke git
git config --global user.email "[email protected]" && git config --global user.name "github-actions"
- name: Audit python dependencies
run: algokit project run audit --project-name 'production_puya_react-contracts'

- name: Lint and format python dependencies
run: algokit project run lint --project-name 'production_puya_react-contracts'

- name: Run tests
shell: bash
run: |
set -o pipefail
algokit project run test --project-name 'production_puya_react-contracts'
- name: Build smart contracts
run: algokit project run build --project-name 'production_puya_react-contracts'

- name: Scan TEAL files for issues
run: algokit project run audit-teal --project-name 'production_puya_react-contracts'

- name: Check output stability of the smart contracts
run: algokit project run ci-teal-diff --project-name 'production_puya_react-contracts'

- name: Run deployer against LocalNet
run: algokit project deploy localnet --project-name 'production_puya_react-contracts'
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release production_puya_react-frontend

on:
workflow_call:
permissions:
contents: read
packages: read

jobs:

deploy:
runs-on: ubuntu-latest
name: Deploy to Netlify
environment: frontend-prod

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install algokit
run: pipx install git+https://github.com/algorandfoundation/algokit-cli@feat/orchestration-linking

- name: Bootstrap dependencies
run: algokit bootstrap all --project-name 'production_puya_react-frontend'

- name: Publish to Netlify
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
run: |
npm install --global netlify-cli@latest
netlify login
netlify deploy --build --prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Validate production_puya_react-frontend

on:

workflow_call:


jobs:
validate:
runs-on: 'ubuntu-latest'
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install poetry
run: pipx install poetry

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "poetry"

- name: Install algokit
run: pipx install git+https://github.com/algorandfoundation/algokit-cli@feat/orchestration-linking

- name: Install dependencies
run: algokit bootstrap all --project-name 'production_puya_react-frontend'


- name: Run linters
run: algokit project run lint --project-name 'production_puya_react-frontend'


- name: Run unit tests
run: algokit project run test --project-name 'production_puya_react-frontend'


- name: Build
run: algokit project run build --project-name 'production_puya_react-frontend'
Loading

0 comments on commit 9dd225d

Please sign in to comment.