Skip to content

Commit 9f86ee5

Browse files
committed
fix: fix scripts
1 parent c9b1adf commit 9f86ee5

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

.github/workflows/release-check.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
check-release:
3131
needs: prepare
3232
runs-on: ubuntu-latest
33+
outputs:
34+
release: ${{ steps.check.outputs.release }}
3335
strategy:
3436
matrix:
3537
directory: ${{ fromJson(needs.prepare.outputs.matrix) }}
@@ -53,8 +55,15 @@ jobs:
5355
run: uv python install
5456

5557
- name: Check release
58+
id: check
5659
run: |
57-
uv run --script scripts/release.py --dry-run "${{ matrix.directory }}" "${{ needs.prepare.outputs.last_release }}" | tee -a "$GITHUB_OUTPUT"
60+
output=$(uv run --script scripts/release.py --dry-run "${{ matrix.directory }}" "${{ needs.prepare.outputs.last_release }}" \
61+
| grep -o -E "[a-zA-Z0-9\-]+@[0-9]+\.[0-9]+\.[0-9]+" || true)
62+
if [ ! -z "$output" ]; then
63+
echo "release<<EOF" >> $GITHUB_OUTPUT
64+
echo "$output" >> $GITHUB_OUTPUT
65+
echo "EOF" >> $GITHUB_OUTPUT
66+
fi
5867
5968
check-tag:
6069
needs: [prepare, check-release]
@@ -64,16 +73,17 @@ jobs:
6473

6574
- name: Simulate tag creation
6675
run: |
67-
if [ -s "$GITHUB_OUTPUT" ]; then
76+
echo "${{ needs.check-release.outputs.release }}" > packages.txt
77+
if [ -s packages.txt ]; then
6878
DATE=$(date +%Y.%m.%d)
6979
echo "🔍 Dry run: Would create tag v${DATE} if this was a real release"
7080
7181
echo "# Release ${DATE}" > notes.md
7282
echo "" >> notes.md
7383
echo "## Updated Packages" >> notes.md
7484
while IFS= read -r line; do
75-
echo "- ${line}" >> notes.md
76-
done < "$GITHUB_OUTPUT"
85+
echo "- $line" >> notes.md
86+
done < packages.txt
7787
7888
echo "🔍 Would create release with following notes:"
7989
cat notes.md

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
env:
6565
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6666
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
67-
run: uv run --script scripts/release.py "${{ matrix.directory }}" "${{ needs.prepare.outputs.last_release }}" >> "$GITHUB_OUTPUT"
67+
run: uv run --script scripts/release.py "${{ matrix.directory }}" "${{ needs.prepare.outputs.last_release }}" >> "$GITHUB_OUTPUT"
6868

6969
create-release:
7070
needs: [prepare, release]

scripts/release.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def main(directory: Path, git_hash: GitHash, dry_run: bool) -> int:
171171
if not dry_run:
172172
click.echo(f"{name}@{version}")
173173
else:
174-
click.echo(f"🔍 Dry run: Would have published {name}@{version} if this was a real release")
174+
click.echo(f"Dry run: Would have published {name}@{version}")
175175
return 0
176176
except Exception as e:
177177
return 1

0 commit comments

Comments
 (0)