Skip to content

Commit

Permalink
Fix wasm artifacts (#1499)
Browse files Browse the repository at this point in the history
* put back emscripten 3.1.19

* add create-tolk-release.yml

* filter out master branch only
  • Loading branch information
neodix42 authored Jan 27, 2025
1 parent e7e57f8 commit 7d9ef6e
Show file tree
Hide file tree
Showing 6 changed files with 927 additions and 2 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build-ton-wasm-emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@ jobs:
chmod +x fift-func-wasm-build-ubuntu.sh
./fift-func-wasm-build-ubuntu.sh -a
- name: Prepare test
run: |
cp assembly/wasm/*.fc .
git clone https://github.com/ton-community/func-js.git
cd func-js
npm install
npm run build
npm link
- name: Test TON WASM artifacts
run: |
base64 -w 0 artifacts/funcfiftlib.wasm > artifacts/funcfiftlib.wasm.js
printf "module.exports = { FuncFiftLibWasm: '" | cat - artifacts/funcfiftlib.wasm.js > temp.txt && mv temp.txt artifacts/funcfiftlib.wasm.js
echo "'}" >> artifacts/funcfiftlib.wasm.js
cp artifacts/funcfiftlib.wasm.js func-js/node_modules/@ton-community/func-js-bin/dist/funcfiftlib.wasm.js
cp artifacts/funcfiftlib.js func-js/node_modules/@ton-community/func-js-bin/dist/funcfiftlib.js
npx func-js stdlib.fc intrinsics.fc --fift ./output.f

- name: Upload artifacts
uses: actions/upload-artifact@master
with:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
workflow: build-ton-linux-arm64-appimage.yml
path: artifacts
workflow_conclusion: success
branch: master
skip_unpack: true

- name: Download and unzip Linux arm64 artifacts
Expand All @@ -25,6 +26,7 @@ jobs:
workflow: build-ton-linux-arm64-appimage.yml
path: artifacts
workflow_conclusion: success
branch: master
skip_unpack: false

- name: Download Linux x86-64 artifacts
Expand All @@ -33,6 +35,7 @@ jobs:
workflow: build-ton-linux-x86-64-appimage.yml
path: artifacts
workflow_conclusion: success
branch: master
skip_unpack: true

- name: Download and unzip Linux x86-64 artifacts
Expand All @@ -41,6 +44,7 @@ jobs:
workflow: build-ton-linux-x86-64-appimage.yml
path: artifacts
workflow_conclusion: success
branch: master
skip_unpack: false

- name: Download Mac x86-64 artifacts
Expand All @@ -49,6 +53,7 @@ jobs:
workflow: build-ton-macos-13-x86-64-portable.yml
path: artifacts
workflow_conclusion: success
branch: master
skip_unpack: true

- name: Download Mac arm64 artifacts
Expand All @@ -57,6 +62,7 @@ jobs:
workflow: build-ton-macos-14-arm64-portable.yml
path: artifacts
workflow_conclusion: success
branch: master
skip_unpack: true

- name: Download and unzip Mac x86-64 artifacts
Expand All @@ -73,6 +79,7 @@ jobs:
workflow: build-ton-macos-14-arm64-portable.yml
path: artifacts
workflow_conclusion: success
branch: master
skip_unpack: false

- name: Download Windows artifacts
Expand All @@ -81,6 +88,7 @@ jobs:
workflow: ton-x86-64-windows.yml
path: artifacts
workflow_conclusion: success
branch: master
skip_unpack: true

- name: Download and unzip Windows artifacts
Expand All @@ -89,6 +97,7 @@ jobs:
workflow: ton-x86-64-windows.yml
path: artifacts
workflow_conclusion: success
branch: master
skip_unpack: false

- name: Download WASM artifacts
Expand All @@ -97,6 +106,7 @@ jobs:
workflow: build-ton-wasm-emscripten.yml
path: artifacts
workflow_conclusion: success
branch: master
skip_unpack: true

- name: Download Android Tonlib artifacts
Expand All @@ -105,6 +115,7 @@ jobs:
workflow: build-ton-linux-android-tonlib.yml
path: artifacts
workflow_conclusion: success
branch: master
skip_unpack: true

- name: Show all artifacts
Expand Down
153 changes: 153 additions & 0 deletions .github/workflows/create-tolk-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: Create tolk release

on:
workflow_dispatch:
inputs:
tag:
description: 'tolk release and tag name'
required: true

permissions: write-all

jobs:
create-release:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3

- name: Download and unzip Linux arm64 artifacts
uses: dawidd6/action-download-artifact@v6
with:
workflow: build-ton-linux-arm64-appimage.yml
path: artifacts
workflow_conclusion: success
branch: master
skip_unpack: false

- name: Download and unzip Linux x86-64 artifacts
uses: dawidd6/action-download-artifact@v6
with:
workflow: build-ton-linux-x86-64-appimage.yml
path: artifacts
workflow_conclusion: success
branch: master
skip_unpack: false

- name: Download and unzip Mac x86-64 artifacts
uses: dawidd6/action-download-artifact@v6
with:
workflow: build-ton-macos-13-x86-64-portable.yml
path: artifacts
workflow_conclusion: success
branch: master
skip_unpack: false

- name: Download and unzip arm64 artifacts
uses: dawidd6/action-download-artifact@v6
with:
workflow: build-ton-macos-14-arm64-portable.yml
path: artifacts
workflow_conclusion: success
branch: master
skip_unpack: false

- name: Download and unzip Windows artifacts
uses: dawidd6/action-download-artifact@v6
with:
workflow: ton-x86-64-windows.yml
path: artifacts
workflow_conclusion: success
branch: master
skip_unpack: false

- name: Download WASM artifacts
uses: dawidd6/action-download-artifact@v6
with:
workflow: build-ton-wasm-emscripten.yml
path: artifacts
workflow_conclusion: success
branch: master
skip_unpack: true

- name: Show all artifacts
run: |
tree artifacts

# create release
- name: Get registration token
id: getRegToken
run: |
curl -X POST -H \"Accept: application/vnd.github+json\" -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/ton-blockchain/ton/actions/runners/registration-token
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ inputs.tag }}
release_name: ${{ inputs.tag }}
draft: false
prerelease: false

# upload

# win

- name: Upload Windows 2019 single artifact - tolk
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: artifacts/ton-x86-64-windows/tolk.exe
asset_name: tolk.exe
tag: ${{ inputs.tag }}

# mac x86-64

- name: Upload Mac x86-64 single artifact - tolk
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: artifacts/ton-x86_64-macos/tolk
asset_name: tolk-mac-x86-64
tag: ${{ inputs.tag }}

# mac arm64

- name: Upload Mac arm64 single artifact - tolk
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: artifacts/ton-arm64-macos/tolk
asset_name: tolk-mac-arm64
tag: ${{ inputs.tag }}

# linux x86-64

- name: Upload Linux x86-64 single artifact - tolk
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: artifacts/ton-x86_64-linux/tolk
asset_name: tolk-linux-x86_64
tag: ${{ inputs.tag }}

# linux arm64

- name: Upload Linux arm64 single artifact - tolk
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: artifacts/ton-arm64-linux/tolk
asset_name: tolk-linux-arm64
tag: ${{ inputs.tag }}

- name: Upload WASM artifacts
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: artifacts/ton-wasm.zip
asset_name: ton-wasm.zip
tag: ${{ inputs.tag }}
4 changes: 2 additions & 2 deletions assembly/wasm/fift-func-wasm-build-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ echo
fi

cd emsdk
./emsdk install 3.1.40
./emsdk activate 3.1.40
./emsdk install 3.1.19
./emsdk activate 3.1.19
EMSDK_DIR=`pwd`

. $EMSDK_DIR/emsdk_env.sh
Expand Down
61 changes: 61 additions & 0 deletions assembly/wasm/intrinsics.fc
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#pragma allow-post-modification;
#pragma compute-asm-ltr;

(slice, slice) __tact_load_address(slice cs) inline {
slice raw = cs~load_msg_addr();
return (cs, raw);
}

slice __gen_slice1 () asm """
B{b5ee9c72410101010005000006abcdefe1e98884} B>boc <s PUSHSLICE
""";

slice __gen_slice_slice_eb58904b617945cdf4f33042169c462cd36cf1772a2229f06171fd899e920b7f() asm """
B{b5ee9c724101010100030000011025086565} B>boc <s PUSHSLICE
""";

slice __gen_slice3 () asm """
B{b5ee9c724101010100030000017888c37a8e} B>boc <s PUSHSLICE
""";

slice __gen_slice_slice_6694a4a61b0dc7c7d5f63bbd394449f6921de7b2ad9cb() asm """
B{b5ee9c724101010100820000ffabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdab} B>boc <s PUSHSLICE
""";

slice __gen_slice_slice_80b26bab85f37e2bde3795993cdf7402cd42e68eff6187e8388083ce6cfe7c92() asm """
B{b5ee9c724101010100030000018a0adc2f9c} B>boc <s PUSHSLICE
""";


(slice,((slice, cell, int, int, slice, slice, int, int, int, int, slice, slice, slice, slice, slice, slice, slice, slice, slice, slice, slice))) IntrinsicsTester_load(slice sc_0) inline {
var v'c = sc_0~__tact_load_address();
var v'd = sc_0~load_ref();
var v'e = sc_0~load_int(257);
var v'f = sc_0~load_int(257);
slice sc_1 = sc_0~load_ref().begin_parse();
var v'g = sc_1~load_ref().begin_parse();
var v'h = sc_1~load_ref().begin_parse();
var v'i = sc_1~load_int(257);
var v'j = sc_1~load_int(257);
var v'k = sc_1~load_int(257);
slice sc_2 = sc_1~load_ref().begin_parse();
var v'l = sc_2~load_int(257);
var v'm = sc_2~load_ref().begin_parse();
var v'n = sc_2~load_ref().begin_parse();
var v'o = sc_2~load_ref().begin_parse();
slice sc_3 = sc_2~load_ref().begin_parse();
var v'p = sc_3~load_ref().begin_parse();
var v'q = sc_3~load_ref().begin_parse();
var v'r = sc_3~load_ref().begin_parse();
slice sc_4 = sc_3~load_ref().begin_parse();
var v's = sc_4~load_ref().begin_parse();
var v't = sc_4~load_ref().begin_parse();
var v'u = sc_4~load_ref().begin_parse();
slice sc_5 = sc_4~load_ref().begin_parse();
var v'w = sc_5~load_ref().begin_parse();
var v'v = sc_5~load_ref().begin_parse();
return (sc_0, (v'c, v'd, v'e, v'f, v'g, v'h, v'i, v'j, v'k, v'l, v'm, v'n, v'o, v'p, v'q, v'r, v's, v't, v'u, v'w, v'v));
}

() recv_internal(int msg_value, cell in_msg_cell, slice in_msg) impure { }

Loading

0 comments on commit 7d9ef6e

Please sign in to comment.