Skip to content

Commit

Permalink
Wasm release action uses MacOS build agent (#226)
Browse files Browse the repository at this point in the history
Fixed an issue that prevented wasm from building correctly, due to incorrect paths of protoc plugin for TS
  • Loading branch information
tmarkovski committed Oct 22, 2021
1 parent 691fe87 commit f12ecb2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
jobs:
build_test:
name: Build
runs-on: "macos-latest"
runs-on: macos-latest
defaults:
run:
working-directory: ./wasm
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ jobs:
uses: microsoft/setup-msbuild@v1.0.2
- name: Generate Package Version
run: |
$json = Invoke-WebRequest 'https://api.github.com/repos/trinsic-id/okapi/releases/latest' | ConvertFrom-Json
$json = Invoke-WebRequest 'https://api.github.com/repos/trinsic-id/okapi/releases/latest' `
-Headers @{ "Authorization" = "Token $env:API_GITHUB_TOKEN"} | ConvertFrom-Json
$version = $json.tag_name.Trim("v")
echo "PACKAGE_VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
shell: pwsh
env:
API_GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }}

- name: Create Nuget package
run: |
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/release-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Publish Npm
environment:
name: npmjs.com
runs-on: windows-latest
runs-on: macos-latest
defaults:
run:
working-directory: ./wasm
Expand All @@ -23,12 +23,19 @@ jobs:
- uses: jetli/wasm-pack-action@v0.3.0
with:
version: 'latest'
- run: |
rustup toolchain uninstall stable
rustup toolchain install stable
rustup toolchain install stable --target wasm32-unknown-unknown
- name: Generate Package Version
run: |
$json = Invoke-WebRequest 'https://api.github.com/repos/trinsic-id/okapi/releases/latest' | ConvertFrom-Json
$json = Invoke-WebRequest 'https://api.github.com/repos/trinsic-id/okapi/releases/latest' `
-Headers @{ "Authorization" = "Token $env:API_GITHUB_TOKEN"} | ConvertFrom-Json
$version = $json.tag_name.Trim("v")
echo "PACKAGE_VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
shell: pwsh
env:
API_GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }}
- run: npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
- run: |
npm run start
Expand Down
8 changes: 4 additions & 4 deletions wasm/Generate-Proto.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Generate protobuf files for JS and TS
param($OutDir = './packages/okapi-proto/src/proto')

$PROTOC_GEN_TS_PATH = "./node_modules/.bin/protoc-gen-ts"
$GRPC_TOOLS_NODE_PROTOC="./node_modules/.bin/grpc_tools_node_protoc"
$OUTPUT_DIR=$OutDir
$PROTO_DIR= Resolve-Path "../proto"
$PROTOC_GEN_TS_PATH = Resolve-Path "./node_modules/.bin/protoc-gen-ts"
$GRPC_TOOLS_NODE_PROTOC = Resolve-Path "./node_modules/.bin/grpc_tools_node_protoc"
$OUTPUT_DIR = $OutDir
$PROTO_DIR = Resolve-Path "../proto"

foreach ($Item in Get-ChildItem -Path $PROTO_DIR -Include *.proto -Recurse) {
$File = $Item.FullName
Expand Down

0 comments on commit f12ecb2

Please sign in to comment.