Skip to content

Commit

Permalink
ci: add action to install algokit
Browse files Browse the repository at this point in the history
  • Loading branch information
kieranroneill committed Nov 9, 2024
1 parent 5884384 commit ced0e10
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 30 deletions.
37 changes: 37 additions & 0 deletions .github/actions/use-algokit/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Use AlgoKit"

description: "Checks if the dependencies have been cached with the hash of the package-lock.json file."

inputs:
algokit_version:
description: "The version of AlgoKit to install"
required: false
default: "latest"

runs:
using: "composite"
steps:
- name: "🔑 Set up cache key"
id: cache-key
run: echo "CACHE_KEY=algokit-${{ inputs.algokit_version }}-$(python --version | cut -d' ' -f2)" >> $GITHUB_ENV
- name: "💾 Cache dependencies"
id: algokit-cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ env.CACHE_KEY }}
restore-keys: |
${{ runner.os }}-algokit-${{ inputs.algokit_version }}
${{ runner.os }}-algokit-
${{ runner.os }}-
- name: "🔧 Setup"
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: "📤 Upgrade pip"
run: python -m pip install --upgrade pip
shell: bash
- name: "📦 Install"
if: steps.algokit-cache.outputs.cache-hit != 'true'
run: pip install algokit==${{ inputs.algokit_version }}
shell: bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "Use Dependencies"
name: "Use npm Dependencies"

description: "Checks if the dependencies have been cached with the hash of the package-lock.json file."
description: "Checks if the npm dependencies have been cached with the hash of the package-lock.json file."

runs:
using: "composite"
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/pull_request_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "🔧 Setup"
uses: ./.github/actions/use-dependencies
uses: ./.github/actions/use-npm-dependencies

get_changed_files:
name: "Get Changed Files"
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "🔧 Setup"
uses: ./.github/actions/use-dependencies
uses: ./.github/actions/use-npm-dependencies
- name: "📥 Get PR Title"
id: get_pr_title
uses: actions/github-script@v7
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "🔧 Setup"
uses: ./.github/actions/use-dependencies
uses: ./.github/actions/use-npm-dependencies
- name: "🔍 Type Check"
run: npm run check:types --workspace=@kibisis/pinakion-js-client

Expand All @@ -93,7 +93,7 @@ jobs:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "🔧 Setup"
uses: ./.github/actions/use-dependencies
uses: ./.github/actions/use-npm-dependencies
- name: "👕 Lint"
run: npm run lint:contract

Expand All @@ -106,7 +106,7 @@ jobs:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "🔧 Setup"
uses: ./.github/actions/use-dependencies
uses: ./.github/actions/use-npm-dependencies
- name: "👕 Lint"
run: npm run lint:js-client

Expand All @@ -118,7 +118,9 @@ jobs:
steps:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "🔧 Setup"
uses: ./.github/actions/use-dependencies
- name: "🔧 Setup npm Dependencies"
uses: ./.github/actions/use-npm-dependencies
- name: "🔧 Setup AlgoKit"
uses: ./.github/actions/use-algokit
- name: "🧪 Test"
run: npm run test:js-client
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ jobs:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "🔧 Setup"
uses: ./.github/actions/use-dependencies
uses: ./.github/actions/use-npm-dependencies
- name: "🔧 Setup AlgoKit"
uses: ./.github/actions/use-algokit
- name: "🏗️ Build"
run: npm run build:contract
- name: "🔖 Release"
Expand All @@ -45,7 +47,9 @@ jobs:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "🔧 Setup"
uses: ./.github/actions/use-dependencies
uses: ./.github/actions/use-npm-dependencies
- name: "🔧 Setup AlgoKit"
uses: ./.github/actions/use-algokit
- name: "📝 Create .npmrc"
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISH_PACKAGES_ACCESS_TOKEN }}" >> .npmrc
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ npm install

### 3.1. Packages

| Name | Description |
|-----------------------------------------------------------------|-------------------------------------------------------------------|
| [`pinakion-contract`](./packages/pinakion-contract/README.md) | The Kibisis Pinakion NFT contract written in TEALScript. |
| [`pinakion-js-client`](./packages/pinakion-js-client/README.md) | The JS client to interact with the Kibisis Pinakion NFT contract. |
| Name | Description |
|--------------------------------------------------------|-------------------------------------------------------------------|
| [`contract`](./packages/pinakion-contract/README.md) | The Kibisis Pinakion NFT contract written in TEALScript. |
| [`js-client`](./packages/pinakion-js-client/README.md) | The JS client to interact with the Kibisis Pinakion NFT contract. |

<sup>[Back to top ^][table-of-contents]</sup>

Expand Down
15 changes: 0 additions & 15 deletions packages/contract/.algokit.toml

This file was deleted.

0 comments on commit ced0e10

Please sign in to comment.