Deploy #1396
This file contains hidden or 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: Deploy | |
on: | |
workflow_run: | |
workflows: [Run Tests] | |
types: [completed] | |
branches: [main] | |
jobs: | |
publish-extension: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
environment: production | |
env: | |
CURSORLESS_REPO_ROOT: ${{ github.workspace }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
# This is needed to get the number of commits in the current branch | |
fetch-depth: 0 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm --color install | |
- name: Compile | |
run: pnpm --color compile | |
- name: Build | |
run: pnpm --color --filter '!cursorless-org' --filter '!cursorless-org-*' build | |
env: | |
CURSORLESS_DEPLOY: true | |
- name: Publish to Open VSX Registry | |
id: publishToOpenVSX | |
uses: HaaLeo/publish-vscode-extension@v2 | |
with: | |
pat: ${{ secrets.OPEN_VSX_TOKEN }} | |
packagePath: packages/cursorless-vscode/dist | |
- name: Publish to Visual Studio Marketplace | |
uses: HaaLeo/publish-vscode-extension@v2 | |
with: | |
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }} | |
registryUrl: https://marketplace.visualstudio.com | |
extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }} | |
publish-neovim-extension: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
environment: production | |
env: | |
CURSORLESS_REPO_ROOT: ${{ github.workspace }} | |
STAGING_DIRECTORY: ${{ github.workspace }}/cursorless.nvim-staging | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm --color install | |
- name: Compile | |
run: pnpm --color compile | |
- name: Build | |
run: pnpm --color --filter '!cursorless-org' --filter '!cursorless-org-*' build | |
env: | |
CURSORLESS_DEPLOY: true | |
- name: Checkout cursorless.nvim plugin repo | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.CURSORLESS_BOT_TOKEN }} | |
repository: hands-free-vim/cursorless.nvim | |
path: ${{ env.STAGING_DIRECTORY }} | |
- name: Configure GPG Key | |
working-directory: ${{ env.STAGING_DIRECTORY }} | |
run: | | |
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import | |
env: | |
GPG_SIGNING_KEY: ${{ secrets.CURSORLESS_BOT_GPG_SIGNING_KEY }} | |
- name: git config | |
working-directory: ${{ env.STAGING_DIRECTORY }} | |
run: | | |
git config user.name cursorless-bot | |
git config user.email 98099035+cursorless-bot@users.noreply.github.com | |
git config user.signingkey A9387720AFC62221 | |
git config commit.gpgsign true | |
- name: Push compiled files to cursorless.nvim plugin repo | |
run: bash -x scripts/deploy-cursorless-nvim.sh ${{ env.STAGING_DIRECTORY }} | |
push-cursorless-talon: | |
name: Push cursorless-talon subrepo | |
runs-on: ubuntu-latest | |
needs: publish-extension | |
environment: production | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.CURSORLESS_BOT_TOKEN }} | |
- name: Configure GPG Key | |
run: | | |
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import | |
env: | |
GPG_SIGNING_KEY: ${{ secrets.CURSORLESS_BOT_GPG_SIGNING_KEY }} | |
- name: git config | |
run: | | |
git config user.name cursorless-bot | |
git config user.email 98099035+cursorless-bot@users.noreply.github.com | |
git config user.signingkey A9387720AFC62221 | |
git config commit.gpgsign true | |
- name: Push cursorless-talon subrepo | |
run: bash -x scripts/deploy-cursorless-talon.sh |