refactor: client is turned back to generated sdk #8
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: Overwrite Proto Directory | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
copy-proto: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Run Bash Script to Overwrite Proto Directory | |
run: | | |
#!/bin/bash | |
REPO_URL="https://github.com/Permify/permify.git" | |
TEMP_DIR="temp_dir" | |
TARGET_DIR="proto" | |
# Clone the repository to a temporary directory | |
git clone --depth=1 $REPO_URL $TEMP_DIR | |
# Check if the clone was successful | |
if [ $? -ne 0 ]; then | |
echo "Failed to clone repository." | |
exit 1 | |
fi | |
# Remove the existing proto directory if it exists | |
if [ -d "$TARGET_DIR" ]; then | |
rm -rf $TARGET_DIR | |
fi | |
# Create the target directory and copy the specific directory to the desired location | |
mkdir -p $TARGET_DIR | |
cp -r $TEMP_DIR/proto/* $TARGET_DIR | |
# Check if the copy was successful | |
if [ $? -ne 0 ]; then | |
echo "Failed to copy the directory." | |
# Clean up the temporary repository directory | |
rm -rf $TEMP_DIR | |
exit 1 | |
fi | |
# Clean up the temporary repository directory | |
rm -rf $TEMP_DIR | |
echo "Successfully copied the proto directory to $TARGET_DIR." | |
- name: Install Node.js and Dependencies | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install Buf | |
run: | | |
# Download and install buf | |
wget https://github.com/bufbuild/buf/releases/download/v1.7.0/buf-Linux-x86_64 -O /usr/local/bin/buf | |
chmod +x /usr/local/bin/buf | |
buf --version | |
- name: Generate Code with Buf | |
run: | | |
# Navigate to the proto directory and run buf generate | |
npm install ts-proto | |
buf generate | |
- name: Add and Commit Changes | |
run: | | |
git config --global user.name 'GitHub Actions Bot' | |
git config --global user.email '<>' | |
git add src/grpc/generated | |
git commit -m "Update generated sdk directory with latest changes" | |
- name: Push Changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git push origin main |