Skip to content

Commit 409f252

Browse files
committed
fix: release action
1 parent cd02164 commit 409f252

File tree

1 file changed

+18
-78
lines changed

1 file changed

+18
-78
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -116,85 +116,25 @@ jobs:
116116
with:
117117
path: artifacts
118118

119-
- name: Remove Same Release
120-
uses: omarabid-forks/action-rollback@stable
121-
continue-on-error: true
122-
with:
123-
tag: ${{ steps.vars.outputs.package_version }}
124-
env:
125-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
126-
127-
- name: Create Release
128-
id: create-release
129-
uses: actions/create-release@latest
130-
env:
131-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
132-
with:
133-
tag_name: ${{ steps.vars.outputs.package_version }}
134-
release_name: Version ${{ steps.vars.outputs.package_version }}
135-
body: ${{ steps.vars.outputs.package_name }} - ${{ steps.vars.outputs.package_version }}
136-
draft: false
137-
prerelease: false
138-
139-
- name: Upload Linux x86_64 binary
140-
uses: actions/upload-release-asset@v1
141-
env:
142-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143-
with:
144-
upload_url: ${{ steps.create-release.outputs.upload_url }}
145-
asset_path: artifacts/ci-linux-x86_64/ci
146-
asset_name: ci-linux-x86_64
147-
asset_content_type: application/octet-stream
148-
149-
- name: Upload Linux aarch64 binary
150-
uses: actions/upload-release-asset@v1
151-
env:
152-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
153-
with:
154-
upload_url: ${{ steps.create-release.outputs.upload_url }}
155-
asset_path: artifacts/ci-linux-aarch64/ci
156-
asset_name: ci-linux-aarch64
157-
asset_content_type: application/octet-stream
158-
159-
- name: Upload Windows x86_64 binary
160-
uses: actions/upload-release-asset@v1
119+
- name: Create Release and Upload Assets
161120
env:
162-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
163-
with:
164-
upload_url: ${{ steps.create-release.outputs.upload_url }}
165-
asset_path: artifacts/ci-windows-x86_64.exe/ci.exe
166-
asset_name: ci-windows-x86_64.exe
167-
asset_content_type: application/octet-stream
168-
169-
- name: Upload Windows aarch64 binary
170-
uses: actions/upload-release-asset@v1
171-
env:
172-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
173-
with:
174-
upload_url: ${{ steps.create-release.outputs.upload_url }}
175-
asset_path: artifacts/ci-windows-aarch64.exe/ci.exe
176-
asset_name: ci-windows-aarch64.exe
177-
asset_content_type: application/octet-stream
178-
179-
- name: Upload macOS x86_64 binary
180-
uses: actions/upload-release-asset@v1
181-
env:
182-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
183-
with:
184-
upload_url: ${{ steps.create-release.outputs.upload_url }}
185-
asset_path: artifacts/ci-macos-x86_64/ci
186-
asset_name: ci-macos-x86_64
187-
asset_content_type: application/octet-stream
188-
189-
- name: Upload macOS aarch64 binary
190-
uses: actions/upload-release-asset@v1
191-
env:
192-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
193-
with:
194-
upload_url: ${{ steps.create-release.outputs.upload_url }}
195-
asset_path: artifacts/ci-macos-aarch64/ci
196-
asset_name: ci-macos-aarch64
197-
asset_content_type: application/octet-stream
121+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122+
TAG: ${{ steps.vars.outputs.package_version }}
123+
PACKAGE_NAME: ${{ steps.vars.outputs.package_name }}
124+
run: |
125+
# Delete existing release if exists
126+
gh release delete "$TAG" --yes || true
127+
128+
# Create release
129+
gh release create "$TAG" \
130+
--title "Version $TAG" \
131+
--notes "$PACKAGE_NAME - $TAG" \
132+
artifacts/ci-linux-x86_64/ci \
133+
artifacts/ci-linux-aarch64/ci \
134+
artifacts/ci-windows-x86_64.exe/ci.exe \
135+
artifacts/ci-windows-aarch64.exe/ci.exe \
136+
artifacts/ci-macos-x86_64/ci \
137+
artifacts/ci-macos-aarch64/ci
198138
199139
- name: Purge artifacts
200140
uses: omarabid-forks/purge-artifacts@v1

0 commit comments

Comments
 (0)