Skip to content

Commit 267476e

Browse files
committed
add release
1 parent 649beee commit 267476e

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release Binary
1+
name: Release
22

33
on:
44
push:
@@ -14,7 +14,7 @@ env:
1414

1515
jobs:
1616
build:
17-
name: Build ${{ matrix.archive }}
17+
name: Build ${{ matrix.target }}
1818
runs-on: ${{ matrix.os }}
1919

2020
strategy:
@@ -71,7 +71,7 @@ jobs:
7171
Copy-Item "target/${{ matrix.target }}/release/${{ matrix.binary }}" "dist/${{ matrix.binary }}"
7272
Compress-Archive -Path "dist/${{ matrix.binary }}" -DestinationPath "${{ matrix.archive }}"
7373
74-
- name: Upload artifact
74+
- name: Upload release artifact
7575
uses: actions/upload-artifact@v4
7676
with:
7777
name: ${{ matrix.archive }}
@@ -88,8 +88,19 @@ jobs:
8888
with:
8989
path: artifacts
9090

91-
- name: Create release
91+
- name: Create or update release
9292
env:
9393
GH_TOKEN: ${{ github.token }}
9494
run: |
95-
gh release create "${GITHUB_REF_NAME}" $(find artifacts -type f) --title "${GITHUB_REF_NAME}" --notes "Automated release for safe-clean ${GITHUB_REF_NAME}"
95+
if gh release view "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
96+
gh release upload "${GITHUB_REF_NAME}" \
97+
$(find artifacts -type f) \
98+
--repo "${GITHUB_REPOSITORY}" \
99+
--clobber
100+
else
101+
gh release create "${GITHUB_REF_NAME}" \
102+
$(find artifacts -type f) \
103+
--repo "${GITHUB_REPOSITORY}" \
104+
--title "${GITHUB_REF_NAME}" \
105+
--notes "Automated release for safe-clean ${GITHUB_REF_NAME}"
106+
fi

0 commit comments

Comments
 (0)