diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9ff79a1..852c52f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -27,7 +27,7 @@ jobs: - run: npm run build - name: Publish to npmjs - run: npm publish + run: npm publish --provenance env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -48,4 +48,4 @@ jobs: uses: softprops/action-gh-release@c9b46fe7aad9f02afd89b12450b780f52dacfb2d with: files: | - *.tgz + wasm-fmt-*.tgz diff --git a/.github/workflows/build.yml b/.github/workflows/test.yml similarity index 64% rename from .github/workflows/build.yml rename to .github/workflows/test.yml index 72f0bd6..820c05a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/test.yml @@ -1,20 +1,28 @@ -name: Build +name: Test on: [push, pull_request] jobs: - build: + test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version-file: ".node-version" - registry-url: "https://registry.npmjs.org" - run: | wget -P ${{ runner.temp }} https://github.com/tinygo-org/tinygo/releases/download/v0.28.1/tinygo_0.28.1_amd64.deb yes | sudo dpkg -i ${{ runner.temp }}/tinygo_0.28.1_amd64.deb - run: npm run build - - run: npm run test + - run: pnpm run /test/ + + - name: Package + run: npm pack + + - name: Upload + uses: actions/upload-artifact@v3 + with: + path: | + wasm-fmt-*.tgz diff --git a/package.json b/package.json index 89e75d8..6f875b7 100644 --- a/package.json +++ b/package.json @@ -38,13 +38,13 @@ "patch": "git apply ./gofmt.patch", "build": "tinygo build -o=gofmt.wasm -target=wasm -no-debug -stack-size=24kb ./src/lib.go", "postbuild": "npm run gofmt && npm run patch", - "test": "node --test" + "test:node": "node --test", + "test:deno": "deno test --allow-read" }, "engines": { "node": ">=16.17.0" }, "publishConfig": { - "access": "public", - "provenance": true + "access": "public" } }