File tree Expand file tree Collapse file tree 1 file changed +24
-7
lines changed
Expand file tree Collapse file tree 1 file changed +24
-7
lines changed Original file line number Diff line number Diff line change 99 pull_request :
1010 workflow_dispatch :
1111
12- permissions :
13- contents : write
1412
15- concurrency :
16- group : ci-${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref_name }}
17- cancel-in-progress : true
13+ # concurrency:
14+ # group: ci-${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref_name }}
15+ # cancel-in-progress: true
1816
1917env :
2018 ROOT : " ${{ github.workspace }}"
@@ -244,10 +242,29 @@ jobs:
244242 cache : true
245243
246244 - name : Compute PKG_VER
247- id : ver
248245 shell : bash
249246 run : |
250- PKG_VER="${GITHUB_REF_NAME#v}"
247+ if [[ "$GITHUB_REF" == refs/tags/* ]]; then
248+ # Extract the tag name
249+ tag="${GITHUB_REF#refs/tags/}"
250+
251+ # Remove leading "v" if present
252+ PKG_VER="${tag#v}"
253+ else
254+ # Get the latest tag, or fall back to "v0.0.0" if none exist
255+ cv=$(git describe --abbrev=0 2>/dev/null || echo "v0.0.0")
256+ # Remove leading "v" if present
257+ cv=${cv#v}
258+
259+ # Split into major/minor components
260+ major=$(echo "$cv" | cut -d. -f1)
261+ minor=$(echo "$cv" | cut -d. -f2)
262+
263+ # Construct the package version: <major>.<minor>.0
264+ PKG_VER="${major}.${minor}.${GITHUB_RUN_NUMBER}"
265+ fi
266+
267+ export PKG_VER
251268 echo "PKG_VER=$PKG_VER" | tee -a "$GITHUB_ENV"
252269
253270 - name : Configure pub.dev credentials
You can’t perform that action at this time.
0 commit comments