code: async def upload_artifacts(context, files):
      
      def to_upload_future(target_path):
          path = os.path.join(context.config['artifact_dir'], target_path)
          content_type, content_encoding = compress_artifact_if_supported(path)
          return asyncio.ensure_future(retry_create_artifact(
              context,
              path,
              target_path=target_path,
              content_type=content_type,
              content_encoding=content_encoding,
          ))
  
      tasks = list(map(to_upload_future, files))
      await raise_future_exceptions(tasks)
docs: Compress and upload the requested files from ``artifact_dir``, preserving relative paths.
  
      Compression only occurs with files known to be supported.
  
      This function expects the directory structure in ``artifact_dir`` to remain
      the same.  So if we want the files in ``public/...``, create an
      ``artifact_dir/public`` and put the files in there.
  
      Args:
          context (scriptworker.context.Context): the scriptworker context.
          files (list of str): files that should be uploaded as artifacts
  
      Raises:
          Exception: any exceptions the tasks raise.