asdasdasd #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate and Publish SDK | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
env: | |
NODE_VERSION: 18.x | |
jobs: | |
generate-sdk: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{env.NODE_VERSION}} | |
registry-url: "https://registry.npmjs.org/" | |
- name: check docker-compose | |
run: | | |
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
chmod +x /usr/local/bin/docker-compose | |
# - name: Run docker-compose | |
# run: | | |
# cp CI/ESS/e2e/docker-compose.e2e.yaml docker-compose.yaml | |
# docker-compose pull | |
# docker-compose build --no-cache | |
# docker-compose up -d | |
# - name: Wait for Backend | |
# run: | | |
# npm install -g wait-on | |
# wait-on http://localhost:3000/api/v3/health --timeout 200000 | |
- name: Show current directory | |
run: pwd | |
- name: Run the SDK generation script | |
run: chmod +x ./scripts/generate-sdk-local.sh | |
- name: Show current directory | |
run: cd scripts && ls -la | |
- name: Show current directory | |
run: ls -la | |
- name: Prepare SDK for publishing | |
run: | | |
cd sdk | |
echo "{}" > package.json | |
npm init -y | |
jq '.name="your-sdk-name" | .version="0.0.1" | .main="index.js" | .author="Your Name" | .license="MIT" | .private=false' package.json > temp.json && mv temp.json package.json | |
working-directory: ./sdk | |
- name: Publish SDK to npm | |
run: npm publish | |
working-directory: ./sdk | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |