def METHOD_NAME(self):
    """Publish GitHub release as record."""
    id_ = uuid.uuid4()
    deposit_metadata = dict(self.metadata)
    deposit = None
    try:
        db.session.begin_nested()
        # TODO: Add filter on Published releases
        previous_releases = self.model.repository.releases.filter_by(
            status=ReleaseStatus.PUBLISHED)
        versioning = None
        stashed_draft_child = None
        if previous_releases.count():
            last_release = previous_releases.order_by(
                    Release.created.desc()).first()
            last_recid = PersistentIdentifier.get(
                'recid', last_release.record['recid'])
            versioning = PIDVersioning(child=last_recid)
            last_record = ZenodoRecord.get_record(
                versioning.last_child.object_uuid)
            deposit_metadata['conceptrecid'] = last_record['conceptrecid']
            if 'conceptdoi' not in last_record:
                last_depid = PersistentIdentifier.get(
                    'depid', last_record['_deposit']['id'])
                last_deposit = ZenodoDeposit.get_record(
                    last_depid.object_uuid)
                last_deposit = last_deposit.registerconceptdoi()
                last_recid, last_record = last_deposit.fetch_published()
            deposit_metadata['conceptdoi'] = last_record['conceptdoi']
            if last_record.get('communities'):
                deposit_metadata.setdefault('communities',
                                            last_record['communities'])
            if versioning.draft_child:
                stashed_draft_child = versioning.draft_child
                versioning.remove_draft_child()
        deposit = self.deposit_class.create(deposit_metadata, id_=id_)
        deposit['_deposit']['created_by'] = self.event.user_id
        deposit['_deposit']['owners'] = [self.event.user_id]
        # Fetch the deposit files
        for key, url in self.files:
            # Make a HEAD request to get GitHub to compute the
            # Content-Length.
            res = self.gh.api.session.head(url, allow_redirects=True)
            # Now, download the file
            res = self.gh.api.session.get(url, stream=True,
                                          allow_redirects=True)
            if res.status_code != 200:
                raise Exception(
                    "Could not retrieve archive from GitHub: {url}"
                    .format(url=url)
                )
            size = int(res.headers.get('Content-Length', 0))
            ObjectVersion.create(
                bucket=deposit.files.bucket,
                key=key,
                stream=res.raw,
                size=size or None,
                mimetype=res.headers.get('Content-Type'),
            )
        # GitHub-specific SIP store agent
        sip_agent = {
            '$schema': current_jsonschemas.path_to_url(
                current_app.config['SIPSTORE_GITHUB_AGENT_JSONSCHEMA']),
            'user_id': self.event.user_id,
            'github_id': self.release['author']['id'],
            'email': self.gh.account.user.email,
        }
        deposit.METHOD_NAME(
            user_id=self.event.user_id, sip_agent=sip_agent,
            spam_check=False)
        recid_pid, record = deposit.fetch_published()
        self.model.recordmetadata = record.model
        if versioning and stashed_draft_child:
            versioning.insert_draft_child(stashed_draft_child)
        record_id = str(record.id)
        db.session.commit()
        # Send Datacite DOI registration task
        if current_app.config['DEPOSIT_DATACITE_MINTING_ENABLED']:
            datacite_register.delay(recid_pid.pid_value, record_id)
        # Index the record
        RecordIndexer().index_by_id(record_id)
    except Exception:
        db.session.rollback()
        # Remove deposit from index since it was not commited.
        if deposit and deposit.id:
            try:
                RecordIndexer().delete(deposit)
            except Exception:
                current_app.logger.exception(
                    "Failed to remove uncommited deposit from index.")
        raise