Skip to content

Commit

Permalink
Use short sha for github release name
Browse files Browse the repository at this point in the history
  • Loading branch information
anuraaga committed Oct 3, 2024
1 parent dbeaea4 commit 9dc3889
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions .github/workflows/release-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,7 @@ jobs:
- name: Set Version
shell: bash
run: |
echo "VERSION=${{ github.sha }}" >> $GITHUB_ENV
echo "RELEASE_VERSION=${{ github.sha }}" >> $GITHUB_ENV
echo "VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Retrieve built artifact
uses: actions/download-artifact@v4
with:
Expand All @@ -265,18 +264,10 @@ jobs:
cat dist/sha256sum.txt
- name: Create or update Release
run: |
echo "Looking for existing release for ${{ env.RELEASE_VERSION }}"
OLD_TAG=$(gh release ls --json name,tagName | jq -r ".[] | select(.name == \"${{ env.RELEASE_VERSION }}\") | .tagName")
if [ -n "$OLD_TAG" ]; then
echo "Updating release ${{ env.RELEASE_VERSION }} to point to new tag ${{ github.sha }}"
gh release edit ${OLD_TAG} --tag ${{ github.sha }}
else
echo "Creating new release ${{ env.RELEASE_VERSION }} pointing to tag ${{ github.sha }}"
gh release create ${{ github.sha }} \
--title ${{ env.RELEASE_VERSION }} \
--draft \
--generate-notes \
--prerelease
fi
echo "Uploading artifacts for tag ${{ github.sha }}"
gh release upload ${{ github.sha }} dist/* --clobber
echo "Creating new release ${{ env.VERSION }} pointing to tag ${{ env.VERSION }}"
gh release create ${{ env.VERSION }} \
--title ${{ env.VERSION }} \
--generate-notes \
--prerelease
echo "Uploading artifacts for tag ${{ env.VERSION }}"
gh release upload ${{ env.VERSION }} dist/* --clobber

0 comments on commit 9dc3889

Please sign in to comment.