mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-13 08:12:40 +10:00
feat: supply drop version during release build
This commit is contained in:
29
.github/workflows/release.yml
vendored
29
.github/workflows/release.yml
vendored
@ -20,8 +20,33 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
fetch-tags: true
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Get base tag
|
||||
id: get_base_tag
|
||||
run: |
|
||||
BASE_TAG=$(git describe --tags --abbrev=0)
|
||||
echo "base_tag=$BASE_TAG" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Determine final tag
|
||||
id: get_final_tag
|
||||
run: |
|
||||
BASE_TAG=${{ steps.get_base_tag.outputs.base_tag }}
|
||||
TODAY=$(date +'%Y.%m.%d')
|
||||
|
||||
echo "Today will be: $TODAY"
|
||||
echo "today=$TODAY" >> $GITHUB_OUTPUT
|
||||
|
||||
if [[ "${{ github.event_name }}" == "release" ]]; then
|
||||
FINAL_TAG="$BASE_TAG"
|
||||
else
|
||||
FINAL_TAG="${BASE_TAG}-nightly.$TODAY"
|
||||
fi
|
||||
|
||||
echo "Drop's release tag will be: $FINAL_TAG"
|
||||
echo "final_tag=$FINAL_TAG" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
@ -45,7 +70,7 @@ jobs:
|
||||
images: |
|
||||
ghcr.io/drop-OSS/drop
|
||||
tags: |
|
||||
type=schedule,pattern=nightly
|
||||
type=schedule,pattern=nightly.${{ steps.get_final_tag.outputs.today }}
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern=v{{major}}.{{minor}}
|
||||
type=semver,pattern=v{{major}}
|
||||
@ -66,3 +91,5 @@ jobs:
|
||||
platforms: linux/amd64,linux/arm64
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
build-args: |
|
||||
BUILD_DROP_VERSION=${{ steps.get_final_tag.outputs.final_tag }}
|
||||
|
||||
Reference in New Issue
Block a user