-
-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): add
version_in_code.yml
workflow
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
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@v2 | ||
|
||
- 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/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 |