Update Version String in rocks.nvim
Code
#282
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: Update Version String in `rocks.nvim` Code | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: ["Release Please"] | |
branches: [master] | |
types: | |
- completed | |
jobs: | |
release: | |
name: release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }} | |
fetch-depth: 0 | |
- name: Update Version String | |
run: | | |
latest_tag=$(git describe --abbrev=0 --tags) | |
echo "Updating `rocks.nvim` Version to $latest_tag" | |
sed -ri "s/constants\.ROCKS_VERSION\s+=\s+\"[0-9\.\-]+\"$/constants.ROCKS_VERSION = \"${latest_tag:1}\"/" lua/rocks/constants.lua | |
- name: Commit Changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "Marc Jakobi" | |
if [[ ! -z $(git status -s) ]]; then | |
git add . | |
git commit -m "chore(constants.lua): update version variable" | |
fi | |
- name: Push to Github | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
repository: "nvim-neorocks/rocks.nvim" | |
branch: master |