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
4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ jobs:
git checkout -b "bump-to-$version"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -am "bump version to $version"
git commit -am "bump package to $version"
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git push --force origin "bump-to-$version"
gh pr create --base main --head "bump-to-$version" \
--title "chore: bump version to $version" \
--title "chore: bump package to $version" \
--body "" \
--reviewer dwilding
24 changes: 4 additions & 20 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
set -euo pipefail
version="$(uvx --from "$PWD" gimmegit --version)"
version="${version#gimmegit }"
echo "Detected version: $version"
echo "version=$version" >> "$GITHUB_OUTPUT"
release=false
if [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
Expand All @@ -43,8 +42,6 @@ jobs:
fi
fi
echo "release=$release" >> "$GITHUB_OUTPUT"
echo "GITHUB_OUTPUT file contents:"
cat "$GITHUB_OUTPUT"

wait-checks:
runs-on: ubuntu-latest
Expand All @@ -66,33 +63,26 @@ jobs:
run: |
set -euo pipefail
sha="${{ github.sha }}"
run_id="${{ github.run_id }}"
echo "SHA: $sha"
echo "Run ID: $run_id"
release=false
# Wait for all other workflow runs on this SHA to complete.
other_runs="$(gh run list --branch main --limit 50 --json databaseId,headSha --jq ".[] | select(.headSha == \"${sha}\") | .databaseId")"
echo "All runs on this SHA: $other_runs"
other_runs="$(echo "$other_runs" | grep -v "$run_id" || true)"
echo "Other runs (excluding this one): $other_runs"
other_runs="$(echo "$other_runs" | grep -v "${{ github.run_id }}" || true)"
all_passed=true
for run in $other_runs; do
echo "Watching run $run..."
if ! gh run watch "$run" --exit-status >/dev/null 2>&1; then
all_passed=false
fi
done
echo "all_passed=$all_passed"
if [[ "$all_passed" == "true" ]]; then
release=true
fi
echo "release=$release" >> "$GITHUB_OUTPUT"
echo "GITHUB_OUTPUT file contents:"
cat "$GITHUB_OUTPUT"

create-draft:
runs-on: ubuntu-latest
needs: wait-checks
needs:
- check-version
- wait-checks
if: needs.wait-checks.outputs.release == 'true'
permissions:
contents: write
Expand All @@ -110,11 +100,5 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
echo "VERSION env: [$VERSION]"
if [[ -z "$VERSION" ]]; then
echo "Error: VERSION is empty"
exit 1
fi
notes="$(uv run --script .github/scripts/write_release_notes.py "$VERSION")"
echo "Notes generated, creating release..."
gh release create "$VERSION" --draft --target main --notes "$notes"
Loading