Skip to content

Commit 49a1320

Browse files
authored
Create update-version-file.yml
When creating a new tag (=release), this action should write the version number into the file `ada/etc/ada-version`.
1 parent 943372f commit 49a1320

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Sync ada-version file
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # run only when a version tag is pushed (like v1.2.3)
7+
8+
jobs:
9+
update-version:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Extract tag
17+
run: echo "VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV
18+
19+
- name: Write ada-version file
20+
run: |
21+
mkdir -p ada/etc
22+
echo "${VERSION}" > ada/etc/ada-version
23+
24+
- name: Commit and push ada-version
25+
run: |
26+
git config user.name "github-actions[bot]"
27+
git config user.email "github-actions[bot]@users.noreply.github.com"
28+
git add ada/etc/ada-version
29+
git commit -m "Update ada-version to ${VERSION}" || echo "No changes"
30+
git push

0 commit comments

Comments
 (0)