Skip to content

Commit

Permalink
ci: documenting releasing process
Browse files Browse the repository at this point in the history
  • Loading branch information
ElysaSrc committed Jul 10, 2024
1 parent 3a641da commit 448b46f
Show file tree
Hide file tree
Showing 14 changed files with 95 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/osrd-ui-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
run: |
VERSION=${GITHUB_REF/refs\/tags\//}
npm ci
npm run lerna -- publish ${VERSION} --force-publish --yes --no-push --no-git-tag-version
npm run lerna -- publish ${VERSION} --yes --no-push --no-git-tag-version
42 changes: 36 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,43 @@

Icons, fonts, colors, components and all user interface items for OSRD project.

## TODO
## Development

We should write a README to explain the goal of the `osrd-ui` repository and the design system as
the whole.
Development will leverage preconstruct. **Documentation yet to come**.

We should also explain how it is related to the `osrd-design` repository.
## Publishing versions

## Credits
In a nutshell: we consider our version numbers metadata of the project. We use [Semantic Versioning](https://semver.org/).

### ui-icons
### Implications

We do not change the version on local package versions, we keep the file to the version `0.0.1-dev` which is not a real version and can be easily identified as a development version.

The version numbers for our releases are solely managed through git tags. It implies that when we update a single package, we release all the project together : even if there are no changes between two release (let's say we update ui-icons but nothing else, we would make a release that would publish all packages anyway).

It's the tradeoff we make to keep the project simple and easy to manage, and to avoid the complexity of managing multiple compatible versions of the project.

In summary : we consider a version number as being an indivisible release of all the subpackages of the repository.

### Making a release

1. Create a annotated git tag (let's say `0.0.30`, you would do a `git tag -a 0.0.30`) on the `dev` branch and push it. **Note: we do not tag with a V in front of the version number, on our example the tag would be 0.0.30 and not v0.0.30**.
2. Create a github release (By convention, we use the same name as the tag with the letter `v` in front of it, `v0.0.30`. You can give fancy names to release if you want to : `0.0.30 : Camembert`, it will only appear in the release page of GitHub).

### Adding a new package to the monorepo

Create a folder and follow the structure of other packages (refer to the Development section for more information).

The package will be picked up automatically as long as it is included in the workspaces of the `package.json` file at the root of the project and that a section is added to the `package.json` in the package itself:

```jsonc
{
// ...
"publishConfig": {
"access": "public"
},
// ...
}
```

If this section is not added, the package will not be published. Having a `"private": true` in the package.json will also prevent the package from being published.
40 changes: 15 additions & 25 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 18 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,41 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
alejandra = {
url = "github:kamadorueda/alejandra/3.0.0";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = { self, nixpkgs, flake-utils, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
outputs = {
self,
nixpkgs,
flake-utils,
alejandra,
...
} @ inputs:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {
inherit system;
overlays = [];
};
fixedNode = pkgs.nodejs-18_x;
fixedNode = pkgs.nodejs_20;
fixedNodePackages = pkgs.nodePackages.override {
nodejs = fixedNode;
};
in
{
in {
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
fixedNode
buildInputs = with pkgs; [
# Nix formatter
alejandra.defaultPackage.${system}

# Node version
fixedNode
fixedNodePackages.npm
fixedNodePackages.yarn
];
};
}
);
}
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "0.0.27",
"version": "0.0.50",
"private": false,
"push": false,
"includeMergedTags": true
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@osrd-project/root",
"version": "0.1.0",
"version": "0.0.1-dev",
"homepage": "/~https://github.com/osrd-project/osrd-ui#readme",
"repository": {
"type": "git",
Expand Down
14 changes: 0 additions & 14 deletions shell.nix

This file was deleted.

5 changes: 2 additions & 3 deletions ui-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@osrd-project/ui-core",
"version": "0.0.27",
"version": "0.0.1-dev",
"license": "LGPL-3.0-or-later",
"bugs": "/~https://github.com/osrd-project/osrd-ui/issues",
"repository": {
Expand Down Expand Up @@ -50,6 +50,5 @@
"rollup-plugin-livereload": "^2.0.5",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-serve": "^1.1.1"
},
"gitHead": "973ad1478be4544e1c97303b844903247d9a9cd7"
}
}
8 changes: 5 additions & 3 deletions ui-icons/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{
"name": "@osrd-project/ui-icons",
"version": "0.0.27",
"version": "0.0.1-dev",
"license": "LGPL-3.0-or-later",
"bugs": "/~https://github.com/osrd-project/osrd-ui/issues",
"repository": {
"type": "git",
"url": "/~https://github.com/osrd-project/osrd-ui.git",
"directory": "ui-icons"
},
"publishConfig": {
"access": "public"
},
"type": "module",
"module": "./dist/index.esm.js",
"types": "./dist/index.d.ts",
Expand Down Expand Up @@ -35,6 +38,5 @@
"devDependencies": {
"cheerio": "^1.0.0-rc.12",
"svgo": "3.2.0"
},
"gitHead": "973ad1478be4544e1c97303b844903247d9a9cd7"
}
}
7 changes: 3 additions & 4 deletions ui-manchette/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@osrd-project/ui-manchette",
"version": "0.0.27",
"version": "0.0.1-dev",
"license": "LGPL-3.0-or-later",
"bugs": "/~https://github.com/osrd-project/osrd-ui/issues",
"repository": {
Expand Down Expand Up @@ -34,7 +34,7 @@
"prepublishOnly": "npm run clean && npm run build"
},
"dependencies": {
"@osrd-project/ui-spacetimechart": "^0.0.27",
"@osrd-project/ui-spacetimechart": "0.0.1-dev",
"classnames": "^2.5.1",
"lodash.isequal": "^4.5.0"
},
Expand All @@ -51,6 +51,5 @@
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-serve": "^1.1.1",
"tailwindcss": "^3.4.1"
},
"gitHead": "973ad1478be4544e1c97303b844903247d9a9cd7"
}
}
2 changes: 1 addition & 1 deletion ui-spacetimechart/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@osrd-project/ui-spacetimechart",
"version": "0.0.27",
"version": "0.0.1-dev",
"license": "LGPL-3.0-or-later",
"bugs": "/~https://github.com/osrd-project/osrd-ui/issues",
"repository": {
Expand Down
5 changes: 2 additions & 3 deletions ui-speedspacechart/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@osrd-project/ui-speedspacechart",
"version": "0.0.27",
"version": "0.0.1-dev",
"license": "LGPL-3.0-or-later",
"bugs": "/~https://github.com/osrd-project/osrd-ui/issues",
"repository": {
Expand Down Expand Up @@ -52,6 +52,5 @@
"rollup-plugin-livereload": "^2.0.5",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-serve": "^1.1.1"
},
"gitHead": "973ad1478be4544e1c97303b844903247d9a9cd7"
}
}
Loading

0 comments on commit 448b46f

Please sign in to comment.