Skip to content

Commit

Permalink
ci: update version variable in code upon every new release
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Nov 28, 2023
1 parent e7012a0 commit 315b268
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/version_in_code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Update Version String in `rocks.nvim` Code

on:
workflow_run:
workflows: ["Release Please"]
branches: [master]
types:
- completed

jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
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 "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
if [[ ! -z $(git status -s) ]]; then
git add .
git commit -m "chore(config.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

0 comments on commit 315b268

Please sign in to comment.