Skip to content

Commit

Permalink
Merge pull request #860 from appwrite/feat-cli-beta-publishing
Browse files Browse the repository at this point in the history
feat(cli): Beta CLI releases
  • Loading branch information
christyjacob4 authored May 28, 2024
2 parents 4b3a3e1 + 0ea07f1 commit 7a9434c
Showing 1 changed file with 47 additions and 0 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 }}"

0 comments on commit 7a9434c

Please sign in to comment.