
Some checks failed
build-and-push-ext / build_push (push) Failing after 42s
- wasm-pack crée pkg/ dans le répertoire source (../sdk_client/pkg) - Ajout de la copie cp -r ../sdk_client/pkg ./pkg après le build - Le dossier pkg/ est maintenant au bon endroit pour le build TypeScript - Build project et Run tests peuvent maintenant s'exécuter correctement
84 lines
2.0 KiB
YAML
84 lines
2.0 KiB
YAML
name: build-and-push-ext
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- ext
|
|
|
|
jobs:
|
|
build_push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '19'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci --include=dev
|
|
|
|
- name: Setup Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
components: rustfmt, clippy
|
|
|
|
- name: Install wasm-pack
|
|
uses: jetli/wasm-pack-action@v0.3.0
|
|
with:
|
|
version: "latest"
|
|
path: "."
|
|
|
|
- name: Setup SSH for git clone
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
|
chmod 600 ~/.ssh/id_rsa
|
|
ssh-keyscan git.4nkweb.com >> ~/.ssh/known_hosts
|
|
|
|
- name: Clone sdk_client
|
|
run: |
|
|
git clone -b dev https://git.4nkweb.com/4nk/sdk_client.git ../sdk_client
|
|
|
|
- name: Build WebAssembly
|
|
run: |
|
|
wasm-pack build --out-dir ./pkg ../sdk_client --target nodejs --dev
|
|
cp -r ../sdk_client/pkg ./pkg
|
|
|
|
- name: Build project
|
|
run: npm run build
|
|
|
|
- name: Run tests
|
|
run: npx vitest run
|
|
|
|
- name: Docker login (git.4nkweb.com)
|
|
shell: bash
|
|
env:
|
|
REG_USER: ${{ secrets.USER }}
|
|
REG_TOKEN: ${{ secrets.TOKEN }}
|
|
run: |
|
|
set -euo pipefail
|
|
echo "$REG_TOKEN" | docker login git.4nkweb.com -u "$REG_USER" --password-stdin
|
|
|
|
- name: Build image (target ext)
|
|
shell: bash
|
|
env:
|
|
DOCKER_BUILDKIT: "1"
|
|
run: |
|
|
set -euo pipefail
|
|
docker build \
|
|
-t git.4nkweb.com/4nk/sdk_signer:ext \
|
|
-f Dockerfile .
|
|
|
|
- name: Push image
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
docker push git.4nkweb.com/4nk/sdk_signer:ext
|