Skip to content

Commit 7ddd04f

Browse files
committed
fix: consolidate release creation into single step
The workflow was creating the release and then trying to upload assets in a separate step, which was causing conflicts. Now creates archives first, then creates the release with all assets in one operation.
1 parent 8bbb846 commit 7ddd04f

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ jobs:
7676
env:
7777
GITHUB_TOKEN: ${{ github.token }}
7878
run: |
79-
if gh release view "${{ github.ref_name }}" --repo "${{ github.repository }}" &>/dev/null; then
79+
set -x # Enable debug output
80+
which gh || echo "gh CLI not found!"
81+
echo "Checking for release: ${{ github.ref_name }}"
82+
if gh release view "${{ github.ref_name }}" --repo "${{ github.repository }}" 2>&1; then
8083
echo "exists=true" >> $GITHUB_OUTPUT
8184
echo "Release ${{ github.ref_name }} already exists"
8285
else
@@ -92,29 +95,23 @@ jobs:
9295
echo "Deleting existing release ${{ github.ref_name }}..."
9396
gh release delete "${{ github.ref_name }}" --repo "${{ github.repository }}" -y
9497
95-
- name: Create Release
96-
uses: softprops/action-gh-release@v1
97-
with:
98-
tag_name: ${{ github.ref }}
99-
name: Release v${{ steps.tag_name.outputs.current_version }}
100-
body: ${{ steps.changelog_reader.outputs.changes }}
101-
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}
102-
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
103-
fail_on_unmatched_files: false
104-
files: |
105-
LICENSE
106-
10798
- name: Create Archives
10899
run: |
109100
mkdir -p sort-nvim
110101
cp -r lua plugin README.md LICENSE CHANGELOG.md sort-nvim/
111102
tar -czf sort-nvim-${{ steps.tag_name.outputs.current_version }}.tar.gz sort-nvim
112103
zip -r sort-nvim-${{ steps.tag_name.outputs.current_version }}.zip sort-nvim
113104
114-
- name: Upload Archives to Release
105+
- name: Create Release with Assets
115106
uses: softprops/action-gh-release@v1
116107
with:
117108
tag_name: ${{ github.ref }}
109+
name: Release v${{ steps.tag_name.outputs.current_version }}
110+
body: ${{ steps.changelog_reader.outputs.changes }}
111+
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}
112+
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
113+
fail_on_unmatched_files: false
118114
files: |
115+
LICENSE
119116
sort-nvim-${{ steps.tag_name.outputs.current_version }}.tar.gz
120117
sort-nvim-${{ steps.tag_name.outputs.current_version }}.zip

0 commit comments

Comments
 (0)