Skip to content

Commit 1006cb5

Browse files
committed
Workflow fix
1 parent a79b7be commit 1006cb5

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
2022

2123
- name: Setup Dart
2224
uses: dart-lang/setup-dart@v1
@@ -32,12 +34,26 @@ jobs:
3234
- name: Bootstrap
3335
run: melos bootstrap
3436

35-
- name: Set release train version
37+
- name: Derive version from tag
3638
run: |
3739
set -euo pipefail
3840
VERSION="${GITHUB_REF_NAME#v}"
3941
echo "Releasing version: $VERSION"
42+
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
43+
44+
- name: Checkout release branch (avoid detached HEAD)
45+
run: |
46+
set -euo pipefail
47+
48+
BRANCH="release/$VERSION"
49+
echo "Checking out $BRANCH"
4050
51+
git fetch origin "$BRANCH:refs/remotes/origin/$BRANCH" --tags --force
52+
git checkout -B "$BRANCH" "origin/$BRANCH"
53+
54+
- name: Set release train version
55+
run: |
56+
set -euo pipefail
4157
# Force every public workspace package to the exact same version.
4258
# We intentionally avoid committing/tagging here; the tag already exists.
4359
melos version --yes \

0 commit comments

Comments
 (0)