Compare commits
1 Commits
v0.0.1-dev
...
v0.0.2-dev
| Author | SHA1 | Date | |
|---|---|---|---|
| e1c218431a |
@@ -1 +1 @@
|
|||||||
version_descriptor: pyproject.toml
|
version_descriptor: setup.py
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
name: check if project is already released
|
name: check if project is already released
|
||||||
on:
|
on:
|
||||||
- pull_request
|
- pull_request
|
||||||
|
- push # TODO test
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
unittest:
|
unittest:
|
||||||
|
|||||||
23
flake.lock
generated
23
flake.lock
generated
@@ -34,31 +34,10 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pyproject-nix": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1764134915,
|
|
||||||
"narHash": "sha256-xaKvtPx6YAnA3HQVp5LwyYG1MaN4LLehpQI8xEdBvBY=",
|
|
||||||
"owner": "pyproject-nix",
|
|
||||||
"repo": "pyproject.nix",
|
|
||||||
"rev": "2c8df1383b32e5443c921f61224b198a2282a657",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "pyproject-nix",
|
|
||||||
"repo": "pyproject.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs"
|
||||||
"pyproject-nix": "pyproject-nix"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
|
|||||||
49
flake.nix
49
flake.nix
@@ -4,41 +4,52 @@
|
|||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
pyproject-nix = {
|
|
||||||
url = "github:pyproject-nix/pyproject.nix";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, pyproject-nix }:
|
outputs = { self, nixpkgs, flake-utils, ... }:
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
|
||||||
pythonProject = pyproject-nix.lib.project.loadPyproject {
|
python = pkgs.python313.withPackages (ps: with ps; [
|
||||||
projectRoot = ./.;
|
isort
|
||||||
};
|
flake8
|
||||||
|
semver
|
||||||
|
toml
|
||||||
|
requests
|
||||||
|
pyyaml
|
||||||
|
packaging
|
||||||
|
]);
|
||||||
|
|
||||||
pythonInterpreter = pkgs.python313;
|
pythonPackage = pkgs.python3Packages.buildPythonPackage {
|
||||||
|
name = "release-action";
|
||||||
|
src = ./.;
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
|
pkgs.envsubst
|
||||||
pkgs.just
|
pkgs.just
|
||||||
pkgs.gitea-actions-runner
|
pkgs.gitea-actions-runner
|
||||||
(pythonInterpreter.withPackages
|
python
|
||||||
(pythonProject.renderers.withPackages {
|
|
||||||
python = pythonInterpreter;
|
|
||||||
extraPackages = ps: with ps; [ flake8 isort ];
|
|
||||||
}))
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
packages.default = pythonInterpreter.pkgs.buildPythonPackage (
|
packages.default = pkgs.writers.writePython3Bin
|
||||||
pythonProject.renderers.buildPythonPackage {
|
"release-action"
|
||||||
python = pythonInterpreter;
|
{
|
||||||
});
|
libraries = with pkgs.python3Packages; [
|
||||||
|
semver # TODO move to setup.py?
|
||||||
|
toml
|
||||||
|
requests
|
||||||
|
pythonPackage
|
||||||
|
pyyaml
|
||||||
|
packaging
|
||||||
|
];
|
||||||
|
}
|
||||||
|
(builtins.readFile ./src/main.py)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
[project]
|
|
||||||
name = "gitea-release-action"
|
|
||||||
version = "0.0.1"
|
|
||||||
description = "reusable action for release workflows"
|
|
||||||
authors = [ ]
|
|
||||||
requires-python = ">=3.13"
|
|
||||||
dependencies = [
|
|
||||||
"semver",
|
|
||||||
"toml",
|
|
||||||
"requests",
|
|
||||||
"pyyaml",
|
|
||||||
"packaging"
|
|
||||||
]
|
|
||||||
|
|
||||||
[project.scripts]
|
|
||||||
gitea-release-action = "main:main_cli"
|
|
||||||
6
setup.py
Normal file
6
setup.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from setuptools import setup
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name='release-action',
|
||||||
|
version='0.0.2',
|
||||||
|
)
|
||||||
@@ -248,7 +248,7 @@ def sync_versions(project_description: ProjectDescription):
|
|||||||
sync(artefact.version_descriptor)
|
sync(artefact.version_descriptor)
|
||||||
|
|
||||||
|
|
||||||
def main_cli():
|
if __name__ == '__main__':
|
||||||
parser = ArgumentParser()
|
parser = ArgumentParser()
|
||||||
parser.add_argument('action', choices=[
|
parser.add_argument('action', choices=[
|
||||||
'declare',
|
'declare',
|
||||||
|
|||||||
Reference in New Issue
Block a user