autopub 1.0.0a8__tar.gz → 1.0.0a10__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: autopub
3
- Version: 1.0.0a8
3
+ Version: 1.0.0a10
4
4
  Summary: Automatic package release upon pull request merge
5
5
  Home-page: https://github.com/autopub/autopub
6
6
  License: AGPL-3.0
@@ -105,16 +105,15 @@ class Autopub:
105
105
  self.release_file.unlink()
106
106
 
107
107
  def publish(self, repository: str | None = None) -> None:
108
- # TODO: shall we put this in a function, to make it
109
- # clear that we are triggering the logic to check the release file?
110
- self.release_data
108
+ release_info = self.release_data
111
109
 
112
110
  for plugin in self.plugins:
111
+ # TODO: maybe pass release info to publish method?
113
112
  if isinstance(plugin, AutopubPackageManagerPlugin):
114
113
  plugin.publish(repository=repository)
115
114
 
116
115
  for plugin in self.plugins:
117
- plugin.post_publish()
116
+ plugin.post_publish(release_info)
118
117
 
119
118
  self._delete_release_file()
120
119
 
@@ -32,7 +32,7 @@ class AutopubPlugin:
32
32
  def on_release_notes_invalid(self, exception: AutopubException): # pragma: no cover
33
33
  ...
34
34
 
35
- def post_publish(self) -> None: # pragma: no cover
35
+ def post_publish(self, release_info: ReleaseInfo) -> None: # pragma: no cover
36
36
  ...
37
37
 
38
38
 
@@ -0,0 +1,18 @@
1
+ from __future__ import annotations
2
+
3
+ from autopub.plugins import AutopubPlugin
4
+ from autopub.types import ReleaseInfo
5
+
6
+
7
+ class GitPlugin(AutopubPlugin):
8
+ def post_publish(self, release_info: ReleaseInfo) -> None:
9
+ self.run_command(["git", "config", "--global", "user.email", "autopub@autopub"])
10
+ self.run_command(["git", "config", "--global", "user.name", "autopub"])
11
+
12
+ self.run_command(["git", "tag", release_info.additional_info["new_version"]])
13
+
14
+ # TODO: config?
15
+ self.run_command(["git", "remove", "RELEASE.md"])
16
+ self.run_command(["git", "add", "--all", "--", ":!main/.autopub"])
17
+ self.run_command(["git", "commit", "-m", "🤖 autopub publish"])
18
+ self.run_command(["git", "push", "--tags"])
@@ -3,7 +3,7 @@ requires-python = ">=3.8"
3
3
 
4
4
  [tool.poetry]
5
5
  name = "autopub"
6
- version = "1.0.0-alpha.8"
6
+ version = "1.0.0-alpha.10"
7
7
  description = "Automatic package release upon pull request merge"
8
8
  authors = ["Justin Mayer <entroP@gmail.com>", "Patrick Arminio <patrick.arminio@gmail.com>"]
9
9
  license = "AGPL-3.0"
@@ -1,17 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from typing import Any
4
-
5
- from autopub.plugins import AutopubPlugin
6
-
7
-
8
- class GitPlugin(AutopubPlugin):
9
- def post_publish(self, repository: str | None = None, **kwargs: Any) -> None:
10
- self.run_command(["git", "config", "--global", "user.email", "autopub@autopub"])
11
- self.run_command(["git", "config", "--global", "user.name", "autopub"])
12
-
13
- self.run_command(["git", "add", "."])
14
-
15
- self.run_command(["git", "commit", "-m", "🤖 autopub publish"])
16
-
17
- self.run_command(["git", "push"])
File without changes
File without changes
File without changes
File without changes