Skip to content

Commit

Permalink
Merge branch 'feat-cli-g2' into feat-multiple-accounts-and-instances
Browse files Browse the repository at this point in the history
  • Loading branch information
Meldiron committed May 29, 2024
2 parents 32452ff + acbec0b commit 0b7a25a
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 4 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/cli-beta-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CLI beta Publish
on:
pull_request:
paths:
- 'templates/cli/**.twig'
- 'src/SDK/Language/CLI.php'

env:
PACKAGE_NAME: "${{ vars.PACKAGE_NAME }}@0.16.0${{ github.event.pull_request.head.sha }}"

jobs:
publish:
environment: cli-testing
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Composer dependencies
run: docker run --rm --volume "$(pwd)":/app composer install --ignore-platform-reqs
- name: Generate SDKS
run: docker run --rm -v "$(pwd)":/app -w /app php:8.1-cli php example.php
- name: Fix permission
run: sudo chown -R 1001:1001 examples
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 'latest'
registry-url: 'https://registry.npmjs.org'
- name: Setup
working-directory: ./examples/cli/
run: npm install
- name: Set version
working-directory: ./examples/cli/
run: |
sed -i "s#appwrite-cli#${{ vars.PACKAGE_NAME }}#g" package.json
sed -i "s#0.16.0#0.16.0${{ github.event.pull_request.head.sha }}#g" package.json
- name: Publish
working-directory: examples/cli/
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Instruction
run: |
echo "Install it by running npm install ${{ env.PACKAGE_NAME }}"
echo "Run it using npx ${{ env.PACKAGE_NAME }}"
8 changes: 4 additions & 4 deletions example.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function getSSLPage($url) {
->setTwitter('appwrite_io')
->setDiscord('564160730845151244', 'https://appwrite.io/discord')
->setDefaultHeaders([
'X-Appwrite-Response-Format' => '0.15.0',
'X-Appwrite-Response-Format' => '1.5.0',
])
;

Expand Down Expand Up @@ -393,7 +393,7 @@ function getSSLPage($url) {
;

$sdk->generate(__DIR__ . '/examples/apple');

// DotNet
$sdk = new SDK(new DotNet(), new Swagger2($spec));

Expand Down Expand Up @@ -442,7 +442,7 @@ function getSSLPage($url) {
// Android

$sdk = new SDK(new Android(), new Swagger2($spec));

$sdk
->setName('Android')
->setNamespace('io appwrite')
Expand All @@ -466,7 +466,7 @@ function getSSLPage($url) {

// Kotlin
$sdk = new SDK(new Kotlin(), new Swagger2($spec));

$sdk
->setName('Kotlin')
->setNamespace('io appwrite')
Expand Down

0 comments on commit 0b7a25a

Please sign in to comment.