aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2021-03-20 12:12:48 -0400
committerGitHub <noreply@github.com>2021-03-20 12:12:48 -0400
commitb0c0c50d32b2a0b7bbe3a561525dc85f821cd0bc (patch)
treeb04a96d57694995118e1729e8c3abb14c3efb8f0
parentfa4ee00fa7485a810793dfc39fc0b3f7a3b11300 (diff)
parenteca091a77c66b5dec7a76559a850d899e533ccf2 (diff)
downloadrneovim-b0c0c50d32b2a0b7bbe3a561525dc85f821cd0bc.tar.gz
rneovim-b0c0c50d32b2a0b7bbe3a561525dc85f821cd0bc.tar.bz2
rneovim-b0c0c50d32b2a0b7bbe3a561525dc85f821cd0bc.zip
Merge pull request #14160 from jamessan/automatic-version-updates
ci(gh): Automatically create PR for version.c updates
-rw-r--r--.github/workflows/nightly.yaml49
1 files changed, 49 insertions, 0 deletions
diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml
new file mode 100644
index 0000000000..431ccd8b61
--- /dev/null
+++ b/.github/workflows/nightly.yaml
@@ -0,0 +1,49 @@
+name: Nightly
+on:
+ schedule:
+ - cron: '3 3 * * *'
+
+jobs:
+ update-vim-patches:
+ runs-on: ubuntu-20.04
+ env:
+ VIM_SOURCE_DIR: ${{ format('{0}/vim-src', github.workspace) }}
+ VERSION_BRANCH: marvim/ci-version-update
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - uses: actions/checkout@v2
+ with:
+ repository: vim/vim
+ path: ${{ env.VIM_SOURCE_DIR }}
+ fetch-depth: 0
+
+ - run: |
+ gh release download -R neovim/neovim -p nvim.appimage
+ chmod a+x nvim.appimage
+ mkdir -p $HOME/.local/bin
+ mv nvim.appimage $HOME/.local/bin/nvim
+ printf '%s\n' "$HOME/.local/bin" >> $GITHUB_PATH
+
+ - name: Setup git config
+ run: |
+ git config --global user.name 'marvim'
+ git config --global user.email 'marvim@users.noreply.github.com'
+
+ - name: Update src/version.c
+ id: update-version
+ run: |
+ git checkout -b ${VERSION_BRANCH}
+ nvim -i NONE -u NONE --headless +'luafile scripts/vimpatch.lua' +q
+ printf '::set-output name=NEW_PATCHES::%s\n' $([ -z "$(git diff)" ]; echo $?)
+
+ - name: Automatic PR
+ if: ${{ steps.update-version.outputs.NEW_PATCHES != 0 }}
+ run: |
+ git add -u
+ git commit -m 'version.c: update [skip ci]'
+ git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${VERSION_BRANCH}
+ gh pr create --fill --label vim-patch --base master --head ${VERSION_BRANCH} || true