mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
708aea2532
Pin every third-party action in .github/workflows/ to a full commit SHA with a trailing version comment, and bump to the latest stable release. Defends against tag-rewrite supply-chain attacks while keeping versions legible.
62 lines
1.8 KiB
YAML
62 lines
1.8 KiB
YAML
name: "SDK Preview"
|
|
|
|
env:
|
|
COMPOSE_FILE: docker-compose.yml
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
platform:
|
|
type: choice
|
|
description: "Platform to build"
|
|
options:
|
|
- client
|
|
- server
|
|
|
|
jobs:
|
|
setup:
|
|
name: Setup & Build SDK
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
- name: Set SDK type
|
|
id: set-sdk
|
|
run: |
|
|
PLATFORM="${{ github.event.inputs.platform }}"
|
|
if [ -z "$PLATFORM" ]; then
|
|
PLATFORM="console"
|
|
fi
|
|
if [ "$PLATFORM" = "server" ]; then
|
|
echo "sdk_type=nodejs" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "sdk_type=web" >> $GITHUB_OUTPUT
|
|
fi
|
|
echo "platform=$PLATFORM" >> $GITHUB_OUTPUT
|
|
|
|
- name: Load and Start Appwrite
|
|
run: |
|
|
docker compose build
|
|
docker compose up -d
|
|
|
|
- name: Generate Specs
|
|
run: |
|
|
docker compose exec appwrite specs --version=latest --mode=normal --git=no
|
|
|
|
- name: Generate SDK
|
|
run: |
|
|
docker compose exec appwrite sdks --platform=${{ steps.set-sdk.outputs.platform }} --sdk=${{ steps.set-sdk.outputs.sdk_type }} --version=latest --git=no
|
|
sudo chown -R $USER:$USER ./app/sdks/${{ steps.set-sdk.outputs.platform }}-${{ steps.set-sdk.outputs.sdk_type }}
|
|
|
|
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: Build and Publish SDK
|
|
working-directory: ./app/sdks/${{ steps.set-sdk.outputs.platform }}-${{ steps.set-sdk.outputs.sdk_type }}
|
|
run: |
|
|
npm install
|
|
npm run build
|
|
npx pkg-pr-new publish --comment=update
|