Merge pull request #5069 from dhiltgen/ci_release

Implement custom github release action
This commit is contained in:
Daniel Hiltgen 2024-06-17 13:59:37 -07:00 committed by GitHub
commit c9e6f0542d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -437,6 +437,7 @@ jobs:
env: env:
OLLAMA_SKIP_IMAGE_BUILD: '1' OLLAMA_SKIP_IMAGE_BUILD: '1'
PUSH: '1' PUSH: '1'
GH_TOKEN: ${{ github.token }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set Version - name: Set Version
@ -460,15 +461,20 @@ jobs:
ls -lh dist/ ls -lh dist/
(cd dist; sha256sum * > sha256sum.txt) (cd dist; sha256sum * > sha256sum.txt)
cat dist/sha256sum.txt cat dist/sha256sum.txt
- uses: ncipollo/release-action@v1 - name: Create or update Release
with: run: |
name: ${{ env.RELEASE_VERSION }} echo "Looking for existing release for ${{ env.RELEASE_VERSION }}"
allowUpdates: true OLD_TAG=$(gh release ls --json name,tagName | jq -r ".[] | select(.name == \"${{ env.RELEASE_VERSION }}\") | .tagName")
artifacts: 'dist/*' if [ -n "$OLD_TAG" ]; then
draft: true echo "Updating release ${{ env.RELEASE_VERSION }} to point to new tag ${GITHUB_REF_NAME}"
prerelease: true gh release edit ${OLD_TAG} --tag ${GITHUB_REF_NAME}
omitBodyDuringUpdate: true else
generateReleaseNotes: true echo "Creating new release ${{ env.RELEASE_VERSION }} pointing to tag ${GITHUB_REF_NAME}"
omitDraftDuringUpdate: true gh release create ${GITHUB_REF_NAME} \
omitPrereleaseDuringUpdate: true --title ${{ env.RELEASE_VERSION }} \
replacesArtifacts: true --draft \
--generate-notes \
--prerelease
fi
echo "Uploading artifacts for tag ${GITHUB_REF_NAME}"
gh release upload ${GITHUB_REF_NAME} dist/* --clobber