Publishes the project
320189
def publish(context):
    """"""
    commit_version_change(context)

    if context.github:
        # github token
        project_settings = project_config(context.module_name)
        if not project_settings['gh_token']:
            click.echo('You need a GitHub token for changes to create a release.')
            click.pause(
                'Press [enter] to launch the GitHub "New personal access '
                'token" page, to create a token for changes.'
            )
            click.launch('https://github.com/settings/tokens/new')
            project_settings['gh_token'] = click.prompt('Enter your changes token')

            store_settings(context.module_name, project_settings)
        description = click.prompt('Describe this release')

        upload_url = create_github_release(
            context, project_settings['gh_token'], description
        )

        upload_release_distributions(
            context,
            project_settings['gh_token'],
            build_distributions(context),
            upload_url,
        )

        click.pause('Press [enter] to review and update your new release')
        click.launch(
            '{0}/releases/tag/{1}'.format(context.repo_url, context.new_version)
        )
    else:
        tag_and_push(context)
57741
def publish(self):
        
        publisher_doc = self.get_publisher_doc()

        with self.published_context():
            # Select the published document
            published = self.one(Q._uid == self._uid)

            # If there's no published version of the document create one
            if not published:
                published = self.__class__()

            # Update the document
            for field, value in publisher_doc.items():
                setattr(published, field, value)

            # Save published version
            published.upsert()

        # Set the revisions number for draft/published version, we use PyMongo
        # directly as it's more convienent to use the shared `_uid`.
        now = datetime.now()

        with self.draft_context():
            self.get_collection().update(
                {'_uid': self._uid},
                {'$set': {'revision': now}}
                )

        with self.published_context():
            self.get_collection().update(
                {'_uid': self._uid},
                {'$set': {'revision': now}}
                )
964179
public function publishRevision()
    {
        if (empty($this->publishedDate)) {
            $this->publishedDate = new \DateTime();
        }

        $this->published = true;
    }
715063
def _publish(self):
        
        obj = self.content_object
        version = self.get_version()
        actioned = False

        # Only update if needed
        if obj.current_version != version:
            version = self.get_version()
            obj.current_version = version
            obj.save(update_fields=['current_version'])
            actioned = True

        return actioned
859014
protected function triggerPublish()
    {
        $this->info('Starting publishing vendor assets.');
        $this->call('vendor:publish');
        $this->info('Publishing vendor assets finished.');

        // Reload config
        $this->laravel['Illuminate\Foundation\Bootstrap\LoadConfiguration']->bootstrap($this->laravel);
    }
622034
def publish(self):
        '''
        
        '''

        self.cleanup

        remote = self.remote
        branch = self.branch
        return self.m(
            'pushing changes to %s/%s' % (remote, branch),
            cmdd=dict(
                cmd='git push -u %s %s' % (remote, branch),
                cwd=self.local
            ),
            more=dict(remote=remote, branch=branch)
        )
733688
function publisher(outputJsFile, done, forceMinified){
		// Check if JSCrambler configs file exist
		const time = process.hrtime();
		const jscramblerConfigs = path.resolve('jscrambler.json');
		fs.stat( jscramblerConfigs, function (err) {
			if ( err ){
				let newTime =
				console.log('  obfuscating code with jScrambler was not executed, because the configs file `jscrambler.json` is not present into project\'s directory.'.yellow);
				console.log('Publication finished!'.gray); // +beautifyTime( process.hrtime(time) ).green + '\u0007'
				return done(err);
			}

			console.log('  obfuscating code with jScrambler...'.gray);
			try {
				var configs = require(jscramblerConfigs);
			} catch (e) {
				return done('    Error on obfuscation! The file configs is not a valid JSON'.red);
			}

			if ( !_.isObject(configs.keys) ||
				_.isEmpty(configs.keys.accessKey) ||
				_.isEmpty(configs.keys.secretKey) ||
				_.isEmpty(configs.applicationId)
			){
				return done( new Error('    Error on obfuscation! Jcrambler\'s configs missed. Ex.: accessKey, secretKey or applicationId.') );
			}


			// Set the file for obfuscation
			if ( !_.isArray(configs.filesSrc) )
				configs.filesSrc = [];

			if ( configs.filesSrc.indexOf(outputJsFile) == -1 )
				configs.filesSrc.push(outputJsFile);

			configs.filesDest = path.dirname( packageJSONFile ); // The project's dirname


			/*
			{
				keys: {
					accessKey: 'YOUR_JSCRAMBLER_ACCESS_KEY',
					secretKey: 'YOUR_JSCRAMBLER_SECRET_KEY'
				},
				host: 'api4.jscrambler.com',
				port: 443,
				applicationId: 'YOUR_APPLICATION_ID',
				filesSrc: [
					'/path/to/src/*.html',
					'/path/to/src/*.js'
				],
				filesDest: '/path/to/destDir/',
				params: {
					stringSplitting: {
						chunk: 1
					}
				}
			}
			*/

			const symbolTable = path.join( configs.filesDest, "symbolTable.json");

			jscrambler
				.protectAndDownload(configs)
				.then(function () {
					try{
						const st = fs.statSync( symbolTable );
						fs.unlinkSync(symbolTable);
					}catch(e){}

					if ( !forceMinified ){
						console.log('Publication finished in '.gray+beautifyTime( process.hrtime(time) ).green + '\u0007');
						return done();
					}

					minify(outputJsFile,{},function(err){
						if (err){
							return done(err);
						}
						console.log('Publication finished in '.gray+beautifyTime( process.hrtime(time) ).green + '\u0007');
						return done();
					});


				})
				.catch(function (err) {
					let message = '    Error on obfuscation! Error while obfuscating the code with jScrambler';
					if ( err && err.message )
						message = `  Error on obfuscation! jScrambler: ${err.message}`;
					done( new Error(message) );
				});

		});
	}
805212
protected function registerAssetPublisher(): void
    {
        $this->app->singleton('asset.publisher', function (Application $app) {
            $publicPath = $app->publicPath();

            // The asset "publisher" is responsible for moving package's assets into the
            // web accessible public directory of an application so they can actually
            // be served to the browser. Otherwise, they would be locked in vendor.
            $publisher = new Asset($app->make('files'), $publicPath);

            $publisher->setPackagePath($app->basePath().'/vendor');

            return $publisher;
        });
    }
815771
def publish (self):
        '''
         
        '''
        self.lock.acquire()
        tw = cmdvel2Twist(self.vel)
        self.lock.release()
        if (self.jdrc.getState() == "flying"):
            self.pub.publish(tw)
200273
def publish():
    """"""
    print("To be ready for release, remember:")
    print("      1) Update the version number (and associated test)")
    print("      2) Update the ChangeLog.rst (and other documentation)")
    print(
        "         ChangeLog should have an line (title) consisting of the version number"
    )
    print("      3) Tag Mercurial with 'Release <version>'")
    print("      4) Push updates to BitBucket")
    print("      5) Set the RELEASE environment variable")
    print("           $ export RELEASE=formic")

    cmd = [
        'bash', '-c',
        'yolk -M formic | grep "^version: " | sed "s/^version: \\(.*\\)$/\\1/"'
    ]
    published_version = subprocess.check_output(cmd).strip()
    our_version = open(os.path.join("formic", "VERSION.txt"), "r").read()

    # sanity test on version
    if "\n" in published_version or\
       len(published_version) < 3 or len(published_version) > 10:
        raise Exception(
            "Published version number seems weird: " + published_version)

    print("Published version:", published_version)
    print("Current version:  ", our_version)

    if our_version == published_version:
        raise Exception(
            "You are attempting to republish version " + our_version)

    # sanity: check ChangeLog starts with our version
    changelog = open("CHANGELOG.rst", "r")
    found = False
    for line in changelog.readlines():
        if line.strip() == our_version:
            print("ChangeLog has an entry")
            found = True
            break
    changelog.close()
    if not found:
        raise Exception(
            "The ChangeLog does not appear to include comments on this release"
        )

    # Sanity check: is there a release tag
    tags = subprocess.check_output("hg tags".split())
    found = False
    looking_for = "Release " + our_version
    for line in tags.split("\n"):
        match = re.match(r"^(.*)\s+[0-9]+:[0-9a-f]+$", line)
        if match:
            tag = match.group(1).strip()
            if tag == looking_for:
                print("Found tag", tag)
                found = True
                break

    if not found:
        raise Exception(
            "Mercurial does not have the release tag: " + looking_for)

    status = subprocess.check_output(["hg", "status"])
    for line in status.split("\n"):
        if len(line) > 0:
            raise Exception("Uncommitted changes present")

    try:
        v = os.environ["RELEASE"]
        if v != "formic":
            raise KeyError()
    except KeyError:
        print("$RELEASE environment variable is not set")
        raise

    subprocess.check_call("python setup.py bdist_egg upload".split())
    subprocess.check_call("python setup.py sdist upload".split())
458393
protected function registerAssetPublishCommand(): void
    {
        $this->app->singleton('command.asset.publish', function (Application $app) {
            return new AssetPublishCommand($app->make('asset.publisher'));
        });
    }
787361
private function publishFiles()
    {
        $publishTag = $this->_packageTag;

        $this->publishes([
            __DIR__ . '/config/' . $this->_packageTag . '.php' => base_path('config/' . $this->_packageTag . '.php'),
        ], $publishTag);

        $this->publishes([
            __DIR__ . '/resources/views' => base_path('resources/views/vendor/' . $this->_packageTag),
        ], $publishTag);

        $this->publishes([
            __DIR__ . '/resources/lang' => base_path('resources/lang/vendor/' . $this->_packageTag),
        ], $publishTag);
    }
1240344
def publish(self):
        """"""

        while True:
            event = yield from self.event_source.get()
            str_buffer = []

            if event == POISON_PILL:
                return

            if isinstance(event, str):
                str_buffer.append(event)

            elif event.type == EventTypes.BLOCK_VALID:
                str_buffer = map(json.dumps, eventify_block(event.data))

            for str_item in str_buffer:
                for _, websocket in self.subscribers.items():
                    yield from websocket.send_str(str_item)
765459
@Override
  protected void publishData(WorkUnitState state, int branchId, boolean publishSingleTaskData,
      Set<Path> writerOutputPathsMoved) throws IOException {
    Path publisherOutputDir = getPublisherOutputDir(state, branchId);
    if (!this.publisherFileSystemByBranches.get(branchId).exists(publisherOutputDir)) {
      WriterUtils.mkdirsWithRecursivePermissionWithRetry(this.publisherFileSystemByBranches.get(branchId),
          publisherOutputDir, this.permissions.get(branchId), this.retrierConfig);
    }
    super.publishData(state, branchId, publishSingleTaskData, writerOutputPathsMoved);
  }
72157
def publish(self, load):
        '''
        
        '''
        extra = load.get('kwargs', {})

        publisher_acl = salt.acl.PublisherACL(self.opts['publisher_acl_blacklist'])

        if publisher_acl.user_is_blacklisted(load['user']) or \
                publisher_acl.cmd_is_blacklisted(load['fun']):
            log.error(
                '%s does not have permissions to run %s. Please contact '
                'your local administrator if you believe this is in error.',
                load['user'], load['fun']
            )
            return {'error': {'name': 'AuthorizationError',
                              'message': 'Authorization error occurred.'}}

        # Retrieve the minions list
        delimiter = load.get('kwargs', {}).get('delimiter', DEFAULT_TARGET_DELIM)
        _res = self.ckminions.check_minions(
            load['tgt'],
            load.get('tgt_type', 'glob'),
            delimiter
        )
        minions = _res['minions']

        # Check for external auth calls and authenticate
        auth_type, err_name, key = self._prep_auth_info(extra)
        if auth_type == 'user':
            auth_check = self.loadauth.check_authentication(load, auth_type, key=key)
        else:
            auth_check = self.loadauth.check_authentication(extra, auth_type)

        # Setup authorization list variable and error information
        auth_list = auth_check.get('auth_list', [])
        error = auth_check.get('error')
        err_msg = 'Authentication failure of type "{0}" occurred.'.format(auth_type)

        if error:
            # Authentication error occurred: do not continue.
            log.warning(err_msg)
            return {'error': {'name': 'AuthenticationError',
                              'message': 'Authentication error occurred.'}}

        # All Token, Eauth, and non-root users must pass the authorization check
        if auth_type != 'user' or (auth_type == 'user' and auth_list):
            # Authorize the request
            authorized = self.ckminions.auth_check(
                auth_list,
                load['fun'],
                load['arg'],
                load['tgt'],
                load.get('tgt_type', 'glob'),
                minions=minions,
                # always accept find_job
                whitelist=['saltutil.find_job'],
            )

            if not authorized:
                # Authorization error occurred. Log warning and do not continue.
                log.warning(err_msg)
                return {'error': {'name': 'AuthorizationError',
                                  'message': 'Authorization error occurred.'}}

            # Perform some specific auth_type tasks after the authorization check
            if auth_type == 'token':
                username = auth_check.get('username')
                load['user'] = username
                log.debug('Minion tokenized user = "%s"', username)
            elif auth_type == 'eauth':
                # The username we are attempting to auth with
                load['user'] = self.loadauth.load_name(extra)

        # If we order masters (via a syndic), don't short circuit if no minions
        # are found
        if not self.opts.get('order_masters'):
            # Check for no minions
            if not minions:
                return {
                    'enc': 'clear',
                    'load': {
                        'jid': None,
                        'minions': minions
                    }
                }
        # Retrieve the jid
        if not load['jid']:
            fstr = '{0}.prep_jid'.format(self.opts['master_job_cache'])
            load['jid'] = self.mminion.returners[fstr](nocache=extra.get('nocache', False))
        self.event.fire_event({'minions': minions}, load['jid'])

        new_job_load = {
                'jid': load['jid'],
                'tgt_type': load['tgt_type'],
                'tgt': load['tgt'],
                'user': load['user'],
                'fun': load['fun'],
                'arg': salt.utils.args.parse_input(
                    load['arg'],
                    no_parse=load.get('no_parse', [])),
                'minions': minions,
            }

        # Announce the job on the event bus
        self.event.fire_event(new_job_load, 'new_job')  # old dup event
        self.event.fire_event(new_job_load, salt.utils.event.tagify([load['jid'], 'new'], 'job'))

        # Save the invocation information
        if self.opts['ext_job_cache']:
            try:
                fstr = '{0}.save_load'.format(self.opts['ext_job_cache'])
                self.mminion.returners[fstr](load['jid'], load)
            except KeyError:
                log.critical(
                    'The specified returner used for the external job cache '
                    '"%s" does not have a save_load function!',
                    self.opts['ext_job_cache']
                )
            except Exception:
                log.critical(
                    'The specified returner threw a stack trace:',
                    exc_info=True
                )

        # always write out to the master job cache
        try:
            fstr = '{0}.save_load'.format(self.opts['master_job_cache'])
            self.mminion.returners[fstr](load['jid'], load)
        except KeyError:
            log.critical(
                'The specified returner used for the master job cache '
                '"%s" does not have a save_load function!',
                self.opts['master_job_cache']
            )
        except Exception:
            log.critical(
                'The specified returner threw a stack trace:',
                exc_info=True
            )
        # Altering the contents of the publish load is serious!! Changes here
        # break compatibility with minion/master versions and even tiny
        # additions can have serious implications on the performance of the
        # publish commands.
        #
        # In short, check with Thomas Hatch before you even think about
        # touching this stuff, we can probably do what you want to do another
        # way that won't have a negative impact.
        pub_load = {
            'fun': load['fun'],
            'arg': salt.utils.args.parse_input(
                load['arg'],
                no_parse=load.get('no_parse', [])),
            'tgt': load['tgt'],
            'jid': load['jid'],
            'ret': load['ret'],
        }

        if 'id' in extra:
            pub_load['id'] = extra['id']
        if 'tgt_type' in load:
            pub_load['tgt_type'] = load['tgt_type']
        if 'to' in load:
            pub_load['to'] = load['to']

        if 'kwargs' in load:
            if 'ret_config' in load['kwargs']:
                pub_load['ret_config'] = load['kwargs'].get('ret_config')

            if 'metadata' in load['kwargs']:
                pub_load['metadata'] = load['kwargs'].get('metadata')

            if 'ret_kwargs' in load['kwargs']:
                pub_load['ret_kwargs'] = load['kwargs'].get('ret_kwargs')

        if 'user' in load:
            log.info(
                'User %s Published command %s with jid %s',
                load['user'], load['fun'], load['jid']
            )
            pub_load['user'] = load['user']
        else:
            log.info(
                'Published command %s with jid %s',
                load['fun'], load['jid']
            )
        log.debug('Published command details %s', pub_load)

        return {'ret': {
                    'jid': load['jid'],
                    'minions': minions
                    },
                'pub': pub_load
                }
989859
def publish(self, message_type=ON_SEND, client_id=None, client_storage=None,
                *args, **kwargs):
        
        self.publisher.publish(
            message_type, client_id, client_storage, *args, **kwargs)
202746
def publish(self, topic, message):
        """"""
        self.connect()
        log.info('publish {}'.format(message))
        self.client.publish(topic, message)