Skip to content

Commit 69f5132

Browse files
committed
Merge branch 'refs/heads/feat-cli-g2' into feat-create-resources
2 parents cf290e2 + 7a9434c commit 69f5132

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CLI beta Publish
2+
on:
3+
pull_request:
4+
paths:
5+
- 'templates/cli/**.twig'
6+
- 'src/SDK/Language/CLI.php'
7+
8+
env:
9+
PACKAGE_NAME: "${{ vars.PACKAGE_NAME }}@0.16.0${{ github.event.pull_request.head.sha }}"
10+
11+
jobs:
12+
publish:
13+
environment: cli-testing
14+
permissions:
15+
contents: write
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout repo
19+
uses: actions/checkout@v3
20+
- name: Setup Composer dependencies
21+
run: docker run --rm --volume "$(pwd)":/app composer install --ignore-platform-reqs
22+
- name: Generate SDKS
23+
run: docker run --rm -v "$(pwd)":/app -w /app php:8.1-cli php example.php
24+
- name: Fix permission
25+
run: sudo chown -R 1001:1001 examples
26+
- name: Setup Node
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 'latest'
30+
registry-url: 'https://registry.npmjs.org'
31+
- name: Setup
32+
working-directory: ./examples/cli/
33+
run: npm install
34+
- name: Set version
35+
working-directory: ./examples/cli/
36+
run: |
37+
sed -i "s#appwrite-cli#${{ vars.PACKAGE_NAME }}#g" package.json
38+
sed -i "s#0.16.0#0.16.0${{ github.event.pull_request.head.sha }}#g" package.json
39+
- name: Publish
40+
working-directory: examples/cli/
41+
run: npm publish --access public
42+
env:
43+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
44+
- name: Instruction
45+
run: |
46+
echo "Install it by running npm install ${{ env.PACKAGE_NAME }}"
47+
echo "Run it using npx ${{ env.PACKAGE_NAME }}"

0 commit comments

Comments
 (0)