2021-04-26 20:38:36 -07:00
|
|
|
name: vim-patches
|
2021-03-18 20:18:26 -07:00
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: '3 3 * * *'
|
2022-12-09 07:32:34 -07:00
|
|
|
workflow_dispatch:
|
2021-03-18 20:18:26 -07:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
update-vim-patches:
|
2022-05-28 10:41:48 -07:00
|
|
|
runs-on: ubuntu-latest
|
2021-04-26 20:29:10 -07:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
2021-03-18 20:18:26 -07:00
|
|
|
env:
|
2023-02-10 05:56:07 -07:00
|
|
|
VIM_SOURCE_DIR: ${{ github.workspace }}/vim-src
|
2021-03-18 20:18:26 -07:00
|
|
|
VERSION_BRANCH: marvim/ci-version-update
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
steps:
|
2023-09-04 05:51:40 -07:00
|
|
|
- uses: actions/checkout@v4
|
2021-03-18 20:18:26 -07:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2023-09-04 05:51:40 -07:00
|
|
|
- uses: actions/checkout@v4
|
2021-03-18 20:18:26 -07:00
|
|
|
with:
|
|
|
|
repository: vim/vim
|
|
|
|
path: ${{ env.VIM_SOURCE_DIR }}
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2022-12-09 07:32:34 -07:00
|
|
|
- run: sudo apt-get install libfuse2
|
|
|
|
|
2021-03-18 20:18:26 -07:00
|
|
|
- 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
|
|
|
|
|
2023-02-20 00:12:59 -07:00
|
|
|
- name: Set up git config
|
2021-03-18 20:18:26 -07:00
|
|
|
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}
|
2022-10-21 03:56:09 -07:00
|
|
|
nvim -V1 -es -i NONE +'luafile scripts/vimpatch.lua' +q
|
2022-11-05 15:22:39 -07:00
|
|
|
printf 'NEW_PATCHES=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
|
2021-03-18 20:18:26 -07:00
|
|
|
|
|
|
|
- name: Automatic PR
|
|
|
|
if: ${{ steps.update-version.outputs.NEW_PATCHES != 0 }}
|
|
|
|
run: |
|
|
|
|
git add -u
|
2024-07-17 03:38:34 -07:00
|
|
|
git commit -m 'docs: update version.c'
|
2021-03-18 20:18:26 -07:00
|
|
|
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${VERSION_BRANCH}
|
2022-01-17 11:32:51 -07:00
|
|
|
gh pr create --draft --fill --label vim-patch --base ${GITHUB_REF#refs/heads/} --head ${VERSION_BRANCH} || true
|