How to download artifact from release?

Hi, I’m trying to download the artifact from a release:

name: Deploy

on:
  release:
    types: [published]

jobs:
  cd:
    name: Deploy
    runs-on: ubuntu-latest
    steps:
      - name: Download artifact
        run: |
          file=${{ github.event.release.assets[0].browser_download_url }}
          echo $file
          curl $file --output function.zip

Curl is not working. Could you, please, help me to find out?

Thanks!