Skip to content

Commit 833980b

Browse files
chore: fix build for wasi and wasm (#4150)
Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org>
1 parent 5ee3788 commit 833980b

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,12 @@ jobs:
6969
- uses: acifani/setup-tinygo@db56321a62b9a67922bb9ac8f9d085e218807bb3 # v2.0.1
7070
with:
7171
tinygo-version: "0.37.0"
72-
- run: ./.github/ci-scripts/release_wasm.sh ${{ env.VERSION }}
72+
- name: Release WASM
73+
env:
74+
VERSION: ${{ env.VERSION }}
75+
run: ./.github/ci-scripts/release_wasm.sh ${VERSION}
7376
- name: Upload assets
7477
uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2.4.1
75-
if: github.ref_type == 'tag'
7678
with:
7779
files: |
7880
./out/release-wasm/gofeatureflag-evaluation_${{ env.VERSION }}.wasi
@@ -86,10 +88,12 @@ jobs:
8688
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
8789

8890
- name: Copy WASM files to wasm-releases repository
91+
env:
92+
VERSION: ${{ env.VERSION }}
8993
run: |
9094
mkdir -p wasm-releases/evaluation
91-
cp ./out/release-wasm/gofeatureflag-evaluation_${{ env.VERSION }}.wasi wasm-releases/evaluation/
92-
cp ./out/release-wasm/gofeatureflag-evaluation_${{ env.VERSION }}.wasm wasm-releases/evaluation/
95+
cp ./out/release-wasm/gofeatureflag-evaluation_${VERSION}.wasi wasm-releases/evaluation/
96+
cp ./out/release-wasm/gofeatureflag-evaluation_${VERSION}.wasm wasm-releases/evaluation/
9397
9498
- name: Create Pull Request to wasm-releases
9599
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
@@ -281,6 +285,8 @@ jobs:
281285

282286
- name: Tagging a new version
283287
working-directory: ./release/${{ env.WEBSITE_DIR }}
288+
env:
289+
VERSION: ${{ env.VERSION }}
284290
run: npm run docusaurus docs:version ${VERSION}
285291

286292
- name: Setup go
@@ -396,6 +402,8 @@ jobs:
396402
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
397403

398404
- name: Bump chart appVersion
405+
env:
406+
VERSION: ${{ env.VERSION }}
399407
run: make bump-helm-chart-version VERSION=${VERSION}
400408

401409
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ build-jsonschema-generator: create-out-dir ## Build the jsonschema-generator in
4444
CGO_ENABLED=0 GO111MODULE=on $(GOWORK_ENV) $(GOCMD) build $(MODFLAG) -o out/bin/jsonschema-generator ./cmd/jsonschema-generator/
4545

4646
build-wasm: create-out-dir ## Build the wasm evaluation library in out/bin/
47-
cd cmd/wasm && $(TINYGOCMD) build -o ../out/bin/gofeatureflag-evaluation.wasm -target wasm -opt=2 -opt=s --no-debug -scheduler=none
47+
cd cmd/wasm && $(TINYGOCMD) build -o ../../out/bin/gofeatureflag-evaluation.wasm -target wasm -opt=2 -opt=s --no-debug -scheduler=none
4848

4949
build-wasi: create-out-dir ## Build the wasi evaluation library in out/bin/
50-
cd cmd/wasm && $(TINYGOCMD) build -o ../out/bin/gofeatureflag-evaluation.wasi -target wasi -opt=2 -opt=s --no-debug -scheduler=none
50+
cd cmd/wasm && $(TINYGOCMD) build -o ../../out/bin/gofeatureflag-evaluation.wasi -target wasi -opt=2 -opt=s --no-debug -scheduler=none
5151

5252
build-modules: ## Run build command to build all modules in the workspace
5353
@echo "Building all modules in the workspace..."

0 commit comments

Comments
 (0)