Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./scripts/publish.sh
run: ./scripts/publish.sh "${{ steps.create-release.outputs.tag }}"
5 changes: 3 additions & 2 deletions scripts/create-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ fi

# Bootstrap the version tag if it doesn't exist.
if ! git describe --tags --abbrev=0 >/dev/null 2>&1; then
echo "No version tags found; bootstrapping $INITIAL_VERSION_TAG"
git tag -a "${INITIAL_VERSION_TAG}" "$(git rev-list --max-parents=0 HEAD)" -m "bootstrap"
first_commit="$(git rev-list --max-parents=0 HEAD)"
git tag -a "$INITIAL_VERSION_TAG" "$first_commit" -m "bootstrap"
echo "No version tags found; bootstrapping $INITIAL_VERSION_TAG on first commit $first_commit"

if [ "$PUSH_TAG" = "true" ]; then
echo "Pushing tag $INITIAL_VERSION_TAG"
Expand Down
10 changes: 9 additions & 1 deletion scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#!/bin/bash

dist_path="dist"
tag="${1}"

if [ -z "$tag" ]; then
echo "Tag is required"
exit 1
fi

echo "Publishing distribution artifacts to GitHub Release $tag"

# Ensure distribution artifacts exist. Add more files if you have them.
ls -lah "$dist_path"

# Upload distribution artifacts to GitHub Release (idempotent if re-run).
gh release upload "${{ steps.tag-version.outputs.tag }}" "$dist_path/*" --clobber
gh release upload "$tag" "$dist_path/*" --clobber