Daily bump neovim #2
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: Daily bump neovim | |
on: | |
schedule: | |
# Run this job everyday at 6:30 AM UTC+8 | |
- cron: '30 22 * * *' | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- uses: DeterminateSystems/nix-installer-action@main | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Bump | |
run: | | |
cd nix && nix run '.#nvfetcher' | |
nix build -L '.#neovim-nightly' | |
./result/bin/nvim --version | |
rm result | |
- name: Try update | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config user.name Avimitin | |
git config user.email dev@avimit.in | |
currentDate=$(date +%F) | |
branch="neovim-nightly-bumping-$currentDate" | |
git checkout -b "$branch" | |
git add 'nix' | |
if ! git diff --quiet --cached --exit-code; then | |
echo "File changed" | |
git commit -m "[nix] Bump neovim nightly" | |
git push origin "$branch" --force-with-lease | |
nix run '.#gh' -- \ | |
pr create --title "Bump Neovim Nightly" --body "Bump neovim." | |
fi |