Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI/CD] Use Docker image through Build pipeline #52

Merged
merged 7 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Release
on:
pull_request:
branches:
- main
types:
- closed

env:
EM_VERSION: 3.1.72

jobs:
release:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [20]
permissions:
contents: read
id-token: write
# releaseブランチからmainにPRがマージされたら
if: |
github.event.pull_request.merged == true
&& startsWith(github.head_ref, 'release/v')
steps:
- uses: actions/checkout@v4

- uses: mymindstorm/setup-emsdk@v14
with:
version: ${{env.EM_VERSION}}

- name: resolve git submodule
run: git submodule update --init --recursive

- name: Build spz wasm binary
run: |
cd ./packages/core/lib/spz-wasm
mkdir ./build
em++ main.cpp \
-Oz \
--closure 1 \
--llvm-lto 1 \
-fno-exceptions \
--std=c++17 \
-lembind \
--emit-tsd main.d.ts \
-o ./build/main.mjs \
-s USE_ZLIB=1 \
-s WASM=1 \
-s SINGLE_FILE=1 \
-s MODULARIZE=1 \
-s EXPORT_ES6=1 \
-s EXPORT_NAME="spzwasm" \
-s ALLOW_MEMORY_GROWTH \
-s EXPORTED_FUNCTIONS="['_malloc', '_free']"

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
registry-url: https://registry.npmjs.org

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build

- name: Publish
run: pnpm publish:all
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
11 changes: 11 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "node_modules/@lerna-lite/cli/schemas/lerna-schema.json",
"version": "0.0.0",
"packages": ["packages/*"],
"npmClient": "pnpm",
"command": {
"version": {
"allowBranch": ["release/v*"]
}
}
}
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
"build:vite": "pnpm -r run build",
"build:wasm": "pnpm -F @spz-loader/core run build:docker",
"build:all": "pnpm run build:wasm && pnpm run build:vite",
"build": "pnpm run build:vite"
"build": "pnpm run build:vite",
"version:set": "pnpm exec lerna version",
"publish:all": "NPM_CONFIG_PROVENANCE=true pnpm publish --filter \"@spz-loader/*\" --access public"
},
"engines": {
"node": ">=16",
"pnpm": ">=8"
},
"license": "Apache-2.0",
"devDependencies": {
"@biomejs/biome": "1.9.4"
"@biomejs/biome": "1.9.4",
"@lerna-lite/cli": "^3.10.0",
"@lerna-lite/version": "^3.10.0"
}
}
Loading