Skip to content

Commit 2125e4a

Browse files
committed
refactor to use gh release create
1 parent 20a8777 commit 2125e4a

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

.github/workflows/release.yaml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,21 @@ jobs:
6666
gsutil -h "Cache-Control:no-cache,max-age=0" cp build/helm/index.yaml gs://helm.coder.com/logstream-kube
6767
6868
- name: Create and upload release
69-
uses: softprops/action-gh-release@v2
70-
with:
71-
token: ${{ github.token }}
72-
tag_name: ${{ github.ref_name }}
73-
files: build/${{ steps.version.outputs.version }}.tgz
74-
prerelease: ${{ contains(github.ref, 'rc') }}
75-
generate_release_notes: true
69+
run: |
70+
set -euo pipefail
71+
version=${{ steps.version.outputs.version }}
72+
73+
if gh release view $version; then
74+
echo "Release $version already exists"
75+
exit 0
76+
else
77+
echo "Creating release $version"
78+
# if version contains -rc, publish as a pre-release and not latest
79+
if [[ $version == *-rc* ]]; then
80+
gh release create $version -t $version --generate-notes --prerelease --latest=false --verify-tag build/${version}.tgz
81+
else
82+
gh release create $version -t $version --generate-notes --verify-tag build/${version}.tgz
83+
fi
84+
fi
85+
env:
86+
GITHUB_TOKEN: ${{ github.token }}

scripts/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fi
3333
# Ensure the builder is bootstrapped and ready to use
3434
docker buildx inspect --bootstrap &>/dev/null
3535

36-
# Build
36+
# Build and push the image
3737
if [ "$CI" = "false" ]; then
3838
docker buildx build --platform linux/"$current" -t coder-logstream-kube --load .
3939
else

0 commit comments

Comments
 (0)