Skip to content

Commit fd06592

Browse files
committed
Merge remote-tracking branch 'origin/main' into spike/oas_clients
2 parents 267c56a + 6ef7dcb commit fd06592

File tree

67 files changed

+4572
-2914
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+4572
-2914
lines changed

.github/workflows/ci_cd.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,33 @@ jobs:
1414
runs-on: ubuntu-latest
1515
outputs:
1616
# The packages that use Uniffi bindings
17-
uniffi_packages: ${{ steps.set_uniffi_packages.outputs.uniffi_packages }}
17+
ffi_packages: ${{ steps.set_ffi_packages.outputs.ffi_packages }}
1818
steps:
19-
- id: set_uniffi_packages
20-
run: echo 'uniffi_packages=["algokit_transact"]' >> $GITHUB_OUTPUT
19+
- id: set_ffi_packages
20+
run: echo 'ffi_packages=["algokit_transact"]' >> $GITHUB_OUTPUT
2121

2222

23+
typescript_wasm_ci_cd:
24+
concurrency: ${{ github.event_name == 'push' && format('cd-{0}', github.ref) || format('ci-typescript_wasm-{0}', github.run_id) }}
25+
needs: setup
26+
uses: ./.github/workflows/typescript_wasm_ci_cd.yml
27+
strategy:
28+
matrix:
29+
crate: ${{ fromJSON(needs.setup.outputs.ffi_packages) }}
30+
with:
31+
crate: ${{ matrix.crate }}
32+
release: ${{ github.event_name == 'push' }}
33+
secrets:
34+
BOT_ID: ${{ secrets.BOT_ID }}
35+
BOT_SK: ${{ secrets.BOT_SK }}
36+
2337
python_uniffi_ci_cd:
38+
concurrency: ${{ github.event_name == 'push' && format('cd-{0}', github.ref) || format('ci-python_uniffi-{0}', github.run_id) }}
2439
needs: setup
2540
uses: ./.github/workflows/python_uniffi_ci_cd.yml
2641
strategy:
2742
matrix:
28-
crate: ${{ fromJSON(needs.setup.outputs.uniffi_packages) }}
43+
crate: ${{ fromJSON(needs.setup.outputs.ffi_packages) }}
2944
with:
3045
crate: ${{ matrix.crate }}
3146
release: ${{ github.event_name == 'push' }}

.github/workflows/python_uniffi_ci_cd.yml

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ env:
3131

3232
jobs:
3333
get_version:
34-
if: inputs.release
3534
runs-on: ubuntu-latest
36-
outputs:
35+
outputs:
3736
tag: ${{ steps.semantic_release.outputs.tag }}
3837
version: ${{ steps.semantic_release.outputs.version }}
3938
version_commit_sha: ${{ steps.set_version_commit_sha.outputs.version_commit_sha }}
@@ -42,16 +41,23 @@ jobs:
4241
working-directory: ./packages/python/${{ inputs.crate }}/
4342
steps:
4443
- uses: actions/create-github-app-token@v1
44+
if: inputs.release
4545
id: app_token
4646
with:
4747
app-id: ${{ secrets.BOT_ID }}
4848
private-key: ${{ secrets.BOT_SK }}
4949
- uses: actions/checkout@v4
50+
with:
51+
ref: ${{ github.ref }}
52+
if: inputs.release
5053
- uses: oven-sh/setup-bun@v2
54+
if: inputs.release
5155
with:
5256
bun-version: latest
5357
- run: cd ../../../ && bun install
58+
if: inputs.release
5459
- name: Semantic Release (dry-run)
60+
if: inputs.release
5561
id: semantic_release
5662
env:
5763
GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}
@@ -104,20 +110,36 @@ jobs:
104110
with:
105111
toolchain: 1.85.0
106112
targets: ${{ matrix.target.name }}
113+
114+
- name: Install Poetry
115+
run: |
116+
pipx install poetry
117+
107118
- uses: actions/setup-python@v5
108119
with:
109120
python-version: ${{ env.PYTHON_VERSION }}
110-
cache: "pip" # caching pip dependencies
121+
cache: "poetry"
122+
cache-dependency-path: packages/python/${{ inputs.crate }}/poetry.lock
111123

112-
- name: pip install
124+
- name: Poetry install
113125
run: |
114126
cd packages/python/${{ inputs.crate }}
115-
pip install ".[dev]"
127+
poetry install --with dev
128+
129+
- name: Build wheel
130+
run: |
131+
cd packages/python/${{ inputs.crate }}
132+
poetry run maturin build --release --features ffi_uniffi
133+
134+
- name: Install wheel
135+
run: |
136+
cd packages/python/${{ inputs.crate }}
137+
poetry run pip install ../../../target/wheels/*.whl --force-reinstall
116138
117139
- name: pytest
118140
run: |
119141
cd packages/python/${{ inputs.crate }}
120-
pytest
142+
poetry run pytest
121143
122144
- name: Upload build artifacts
123145
if: inputs.release
@@ -188,47 +210,48 @@ jobs:
188210
RUN: rustup target add ${{ env.TARGET }}
189211
run: docker exec build-container bash -c "$RUN"
190212

191-
- name: Install pip-tools
213+
- name: Install Poetry
192214
env:
193-
RUN: python${{ env.PYTHON_VERSION }} -m pip install pip-tools
215+
RUN: pipx install poetry --python python${{ env.PYTHON_VERSION }}
194216
run: docker exec build-container bash -c "$RUN"
195217

196218
- name: Install dependencies
197219
env:
198220
RUN: |
199221
set -e
200222
cd /workspace/packages/python/${{ inputs.crate }}
201-
python${{ env.PYTHON_VERSION }} -m piptools compile pyproject.toml --extra dev -o requirements.txt
202-
python${{ env.PYTHON_VERSION }} -m pip install -r requirements.txt
223+
poetry env use python${{ env.PYTHON_VERSION }}
224+
poetry install --with dev
203225
run: docker exec build-container bash -c "$RUN"
204226

205227
- name: maturin build
206228
env:
207229
RUN: |
208230
cd /workspace/packages/python/${{ inputs.crate }}
209-
python${{ env.PYTHON_VERSION }} -m maturin build --release --target ${{ env.TARGET }} --compatibility ${{ env.MANYLINUX }} --features ffi_uniffi
231+
poetry run maturin build --release --target ${{ env.TARGET }} --compatibility ${{ env.MANYLINUX }} --features ffi_uniffi
210232
run: docker exec build-container bash -c "$RUN"
211233

212-
- name: pip install wheel
234+
- name: Install wheel
213235
env:
214-
RUN: python${{ env.PYTHON_VERSION }} -m pip install /workspace/target/wheels/*.whl
236+
RUN: |
237+
cd /workspace/packages/python/${{ inputs.crate }}
238+
poetry run pip install /workspace/target/wheels/*.whl
215239
run: docker exec build-container bash -c "$RUN"
216240

217241
- name: pytest
218242
env:
219243
RUN: |
220244
cd /workspace/packages/python/${{ inputs.crate }}
221-
python${{ env.PYTHON_VERSION }} -m pytest
245+
poetry run pytest
222246
run: docker exec build-container bash -c "$RUN"
223-
247+
224248
- name: Upload build artifacts
225249
if: inputs.release
226250
uses: actions/upload-artifact@v4
227251
with:
228252
name: ${{ env.TARGET }}-wheel
229253
path: target/wheels
230254

231-
232255
release:
233256
if: inputs.release && needs.get_version.outputs.version != ''
234257
needs:
@@ -255,6 +278,7 @@ jobs:
255278
uses: actions/download-artifact@v4
256279
with:
257280
path: artifacts
281+
merge-multiple: true
258282

259283
- uses: oven-sh/setup-bun@v2
260284
with:
@@ -267,7 +291,7 @@ jobs:
267291
env:
268292
GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}
269293
run: "bun semantic-release"
270-
294+
271295
cleanup:
272296
if: inputs.release && (failure() || cancelled())
273297
runs-on: ubuntu-latest
@@ -285,8 +309,8 @@ jobs:
285309
- name: Reset branch
286310
if: needs.get_version.outputs.version_commit_sha != ''
287311
env:
288-
GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}
289-
run: |
312+
GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}
313+
run: |
290314
git config user.name "github-actions[bot]"
291315
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
292316
git revert --no-commit ${{ needs.get_version.outputs.version_commit_sha }}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: TypeScript CI
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
crate:
7+
required: true
8+
type: string
9+
description: "The name of the crate to build and publish"
10+
release:
11+
required: false
12+
type: boolean
13+
default: false
14+
description: "Whether to run release steps"
15+
secrets:
16+
BOT_ID:
17+
required: true
18+
BOT_SK:
19+
required: true
20+
21+
permissions:
22+
contents: write # to make commits
23+
actions: write # to upload artifacts
24+
issues: write # to be able to comment on released issues
25+
pull-requests: write # to be able to comment on released pull requests
26+
27+
jobs:
28+
build_and_test:
29+
defaults:
30+
run:
31+
shell: bash
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/create-github-app-token@v1
35+
if: inputs.release
36+
id: app_token
37+
with:
38+
app-id: ${{ secrets.BOT_ID }}
39+
private-key: ${{ secrets.BOT_SK }}
40+
- uses: actions/checkout@v4
41+
with:
42+
ref: ${{ github.ref }}
43+
- uses: dtolnay/rust-toolchain@master
44+
with:
45+
toolchain: 1.85.0
46+
- uses: oven-sh/setup-bun@v2
47+
with:
48+
bun-version: latest
49+
- run: bun install --frozen-lockfile
50+
- name: Build
51+
run: bun scripts/build ${{ inputs.CRATE }} typescript
52+
- name: Test
53+
run: cd packages/typescript/${{ inputs.CRATE }} && bun test
54+
- name: Release
55+
if: inputs.release
56+
env:
57+
GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}
58+
run: bun release:${{ inputs.CRATE }}:ts

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ node_modules/
88
.build
99
.bin/
1010
.vscode/
11-
12-
.DS_Store
11+
.DS_Store

0 commit comments

Comments
 (0)