forked from nvim-neorg/neorg
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) · 1.13 KB
/
version_in_code.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Update Version String in Neorg Code
on:
workflow_run:
workflows: ["Release Please Automatic Semver"]
branches: [main]
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 Neorg Version to $latest_tag"
sed -ri "s/\sversion\s*=\s*\"[0-9]+\.[0-9]+\.[0-9]+\",$/ version = \"${latest_tag:1}\",/" lua/neorg/core/config.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-neorg/neorg"
branch: main