macify-linux icon indicating copy to clipboard operation
macify-linux copied to clipboard

Need to change all the git repos to install from latest release rather than master branch when possible

Open jonchun opened this issue 4 years ago • 4 comments

Title.

jonchun avatar Apr 23 '20 18:04 jonchun

Fairly easy to do. A shell script is like this:

# Get new tags from remote
git fetch --tags

# Get latest tag name
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
if [ "$latestTag" == "" ]; then
  latestTag="master"
fi

# Checkout latest tag
git checkout $latestTag

I guess you could copy the def git_clone in utils. Let it execute the above when it's done cloning. Python is not my strong side though.

woopstar avatar Aug 14 '20 07:08 woopstar

This looks good, but comes with the assumption that all tags are releases and I'm not sure this is what we would want. Probably need to find a way to grab the latest release specifically (if it exists) from the releases page: https://github.com/psifidotos/applet-window-appmenu/releases, and default to master if it doesn't.

jonchun avatar Aug 14 '20 14:08 jonchun

Sure.

JSON outputs are nice to handle in Python.

You can just fetch the output from:

$ curl --silent "https://api.github.com/repos/psifidotos/applet-window-appmenu/releases/latest"
{
  "url": "https://api.github.com/repos/psifidotos/applet-window-appmenu/releases/21712566",
  "assets_url": "https://api.github.com/repos/psifidotos/applet-window-appmenu/releases/21712566/assets",
  "upload_url": "https://uploads.github.com/repos/psifidotos/applet-window-appmenu/releases/21712566/assets{?name,label}",
  "html_url": "https://github.com/psifidotos/applet-window-appmenu/releases/tag/v0.6.0",
  "id": 21712566,
  "node_id": "MDc6UmVsZWFzZTIxNzEyNTY2",
  "tag_name": "v0.6.0",
  "target_commitish": "master",
  "name": "Version 0.6.0",
  "draft": false,
  "author": {
    "login": "psifidotos",
    "id": 2216474,
    "node_id": "MDQ6VXNlcjIyMTY0NzQ=",
    "avatar_url": "https://avatars0.githubusercontent.com/u/2216474?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/psifidotos",
    "html_url": "https://github.com/psifidotos",
    "followers_url": "https://api.github.com/users/psifidotos/followers",
    "following_url": "https://api.github.com/users/psifidotos/following{/other_user}",
    "gists_url": "https://api.github.com/users/psifidotos/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/psifidotos/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/psifidotos/subscriptions",
    "organizations_url": "https://api.github.com/users/psifidotos/orgs",
    "repos_url": "https://api.github.com/users/psifidotos/repos",
    "events_url": "https://api.github.com/users/psifidotos/events{/privacy}",
    "received_events_url": "https://api.github.com/users/psifidotos/received_events",
    "type": "User",
    "site_admin": false
  },
  "prerelease": false,
  "created_at": "2019-11-24T07:27:55Z",
  "published_at": "2019-11-24T10:00:48Z",
  "assets": [

  ],
  "tarball_url": "https://api.github.com/repos/psifidotos/applet-window-appmenu/tarball/v0.6.0",
  "zipball_url": "https://api.github.com/repos/psifidotos/applet-window-appmenu/zipball/v0.6.0",
  "body": "* new option to support color schemes for menus. For Latte a new option to colorize the menus based on the current window color scheme is already present.\r\n* release menu item hovering when not needed any more\r\n* new option to maximize/restore active window when used in plasma panels [@ Taras Fomin]"
}

And then use the output from tag_name key.

woopstar avatar Aug 18 '20 07:08 woopstar

Perfect. All the research is here now :) thanks

jonchun avatar Aug 18 '20 19:08 jonchun