From 6dac8250a6af002f676e9456b66e160bedbefae1 Mon Sep 17 00:00:00 2001 From: martindonadieu Date: Sun, 24 Jul 2022 13:55:22 +0100 Subject: [PATCH] fix: org and CI --- .github/workflows/build.yml | 32 +++++++++++++++++++++++++++ .github/workflows/bump_version.yml | 35 ++++++++++++++++++++++++++++++ README.md | 2 +- 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/bump_version.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..6401da6 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,32 @@ +name: Build source code and send to Capgo + +on: + push: + tags: + - '*' + +jobs: + deploy: + runs-on: ubuntu-latest + name: "Build code and release" + steps: + - name: Check out + uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '16' + - name: Install dependencies + id: install_code + run: npm i + # - name: Lint + # id: lint_code + # run: npm run lint + - name: Build + id: build_code + run: npm run build + - uses: JS-DevTools/npm-publish@v1 + with: + access: public + token: ${{ secrets.NPM_TOKEN }} + + diff --git a/.github/workflows/bump_version.yml b/.github/workflows/bump_version.yml new file mode 100644 index 0000000..107853e --- /dev/null +++ b/.github/workflows/bump_version.yml @@ -0,0 +1,35 @@ +name: Bump version + +on: + push: + branches: + - main + - development + +jobs: + bump-version: + if: "!startsWith(github.event.head_commit.message, 'chore(release):')" + runs-on: ubuntu-latest + name: "Bump version and create changelog with standard version" + steps: + - name: Check out + uses: actions/checkout@v2 + with: + fetch-depth: 0 + token: '${{ secrets.PERSONAL_ACCESS_TOKEN }}' + - name: Git config + run: | + git config --local user.name "github-actions[bot]" + git config --local user.email "github-actions[bot]@users.noreply.github.com" + - name: Create bump and changelog main + if: github.ref == 'refs/heads/main' + run: npx standard-version + - name: Create bump and changelog development + if: github.ref != 'refs/heads/main' + run: npx standard-version --prerelease alpha + - name: Push to origin + run: | + CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) + remote_repo="https://${GITHUB_ACTOR}:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" + git pull $remote_repo $CURRENT_BRANCH + git push $remote_repo HEAD:$CURRENT_BRANCH --follow-tags --tags \ No newline at end of file diff --git a/README.md b/README.md index b13903d..5eb650d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Crisp native SDK for capacitor ## Install ```bash -npm install capacitor-crisp +npm install @capgo/capacitor-crisp npx cap sync ```