feat(ci): add automatic version generation with timestamp and commit hash

This commit is contained in:
xboard 2025-01-13 21:29:49 +08:00
parent d2462bc683
commit 7ca701a079
2 changed files with 7 additions and 1 deletions

View File

@ -56,6 +56,12 @@ jobs:
id: get_version id: get_version
run: echo "version=$(git describe --tags --always)" >> $GITHUB_OUTPUT run: echo "version=$(git describe --tags --always)" >> $GITHUB_OUTPUT
- name: Update version in app.php
run: |
VERSION=$(date '+%Y%m%d')-$(git rev-parse --short HEAD)
sed -i "s/'version' => '.*'/'version' => '$VERSION'/g" config/app.php
echo "Updated version to: $VERSION"
- name: Build and push - name: Build and push
id: build-and-push id: build-and-push
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5

View File

@ -187,5 +187,5 @@ return [
| The only modification by laravel config | The only modification by laravel config
| |
*/ */
'version' => '0.1.1-dev' 'version' => '0.0.1'
]; ];