@@ -52,18 +52,12 @@ jobs:
5252 echo "tag=v$VERSION" >> "$GITHUB_OUTPUT"
5353 fi
5454
55- - name : Embed version in script
56- if : steps.next-version.outputs.will-release == 'true'
57- run : |
58- # Embed version before release-it commits, so the tagged commit has it
59- sed -i "s/__VERSION__/${{ steps.next-version.outputs.tag }}/" bin/git-wt
60-
6155 - name : Run release-it
6256 id : release
6357 if : steps.next-version.outputs.will-release == 'true'
6458 run : |
6559 # Run release-it to bump version, update changelog, commit, and tag
66- # The version-embedded script will be included in the commit
60+ # Source keeps __VERSION__ placeholder - version embedded only in release asset
6761 if yarn release-it --ci; then
6862 echo "released=true" >> "$GITHUB_OUTPUT"
6963 echo "version=${{ steps.next-version.outputs.version }}" >> "$GITHUB_OUTPUT"
7670 - name : Create GitHub release
7771 if : steps.release.outputs.released == 'true'
7872 run : |
73+ # Create versioned copy for release asset (source keeps __VERSION__)
74+ cp bin/git-wt /tmp/git-wt
75+ sed -i 's/__VERSION__/${{ steps.release.outputs.tag }}/' /tmp/git-wt
7976 gh release create "${{ steps.release.outputs.tag }}" \
80- bin/ git-wt \
77+ /tmp/git-wt# git-wt \
8178 --title "${{ steps.release.outputs.tag }}" \
8279 --generate-notes
8380
@@ -109,12 +106,22 @@ jobs:
109106 echo "version=$VERSION" >> "$GITHUB_OUTPUT"
110107 echo "tag=$TAG" >> "$GITHUB_OUTPUT"
111108
112- # Download source tarball and calculate SHA256
113- TARBALL_URL="https://github.com/${{ github.repository }}/archive/refs/tags/${TAG}.tar.gz"
114- echo "Downloading tarball from: $TARBALL_URL"
115- SHA256=$(curl -sL "$TARBALL_URL" | shasum -a 256 | cut -d' ' -f1)
116- echo "sha256=$SHA256" >> "$GITHUB_OUTPUT"
117- echo "Successfully got SHA256: $SHA256"
109+ # Download release asset and calculate SHA256
110+ ASSET_URL="https://github.com/${{ github.repository }}/releases/download/${TAG}/git-wt"
111+ echo "Downloading release asset from: $ASSET_URL"
112+ # Retry a few times in case of CDN propagation delay
113+ for i in {1..5}; do
114+ if curl -fsSL "$ASSET_URL" -o /tmp/git-wt; then
115+ SHA256=$(shasum -a 256 /tmp/git-wt | cut -d' ' -f1)
116+ echo "sha256=$SHA256" >> "$GITHUB_OUTPUT"
117+ echo "Successfully got SHA256: $SHA256"
118+ exit 0
119+ fi
120+ echo "Attempt $i failed, retrying in 5s..."
121+ sleep 5
122+ done
123+ echo "Failed to download release asset"
124+ exit 1
118125
119126 - name : Clone homebrew-devsetup
120127 run : |
@@ -130,7 +137,7 @@ jobs:
130137 class GitWt < Formula
131138 desc 'Interactive TUI for git worktree management'
132139 homepage 'https://github.com/nsheaps/git-wt'
133- url 'https://github.com/nsheaps/git-wt/archive/refs/tags/ ${{ steps.release.outputs.tag }}.tar.gz '
140+ url 'https://github.com/nsheaps/git-wt/releases/download/ ${{ steps.release.outputs.tag }}/git-wt '
134141 sha256 '${{ steps.release.outputs.sha256 }}'
135142 license 'MIT'
136143
@@ -141,7 +148,11 @@ jobs:
141148 depends_on 'gum'
142149
143150 def install
144- bin.install 'bin/git-wt'
151+ if build.head?
152+ bin.install 'bin/git-wt'
153+ else
154+ bin.install 'git-wt'
155+ end
145156 end
146157
147158 test do
0 commit comments