From 9c5d7108a74fd49a9081b8be7c13926964294441 Mon Sep 17 00:00:00 2001
From: Moul <moul@moul.re>
Date: Tue, 19 Apr 2022 22:03:07 +0200
Subject: [PATCH] [mod] #408: Switch default branch from dev/master to main

Change in the CI, changes in the documentation

Enable branch check in release.sh, can be commented for releases
on other branches for maintenance releases.
---
 .gitlab-ci.yml            | 2 +-
 CONTRIBUTING.md           | 5 ++---
 README.md                 | 6 +++---
 pyproject.toml            | 4 ++--
 release.sh                | 6 +++---
 release_notes/v0.8.md     | 4 ++--
 release_notes/v0.9.0rc.md | 2 +-
 release_notes/v0.9.md     | 2 +-
 8 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6dd8ba1c..e8287301 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -176,7 +176,7 @@ pages:
   extends: .changes
   needs: ["tests:3.9:coverage"]
   rules:
-    - if: $CI_COMMIT_BRANCH == "dev"
+    - if: $CI_COMMIT_BRANCH == "main"
   stage: coverage
   script: mv cov_html/ public/
   artifacts:
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index df3fba04..3945c3dd 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -13,9 +13,8 @@ Dependencies will be installed in it in order to have Silkaj running and to have
 - We prefer fast-forward and rebase method than having a merge commit. This in order to have a clean history.
 
 ## Branches
-- `master` branch as stable
-- maintainance branches, to maintain a stable version while developing future version with breaking changes. For instance: `0.7`
-- `dev` branch
+- `main`: development and stable branch
+- maintainance branches, to maintain a stable version while developing future version with breaking changes. For instance: `0.10`
 
 ## Developing with DuniterPy
 [DuniterPy](https://git.duniter.org/clients/python/duniterpy) is a Python library for Duniter clients.
diff --git a/README.md b/README.md
index c22fd54b..997a9a1c 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-<img src="https://git.duniter.org/clients/python/silkaj/raw/dev/logo/silkaj_logo.svg" width="250" />
+<img src="https://git.duniter.org/clients/python/silkaj/raw/main/logo/silkaj_logo.svg" width="250" />
 
 # Silkaj
 [![Version](https://img.shields.io/pypi/v/silkaj.svg)](https://pypi.python.org/pypi/silkaj)
@@ -6,9 +6,9 @@
 [![Python versions](https://img.shields.io/pypi/pyversions/silkaj.svg)](https://pypi.python.org/pypi/silkaj)
 [![Code format](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
 [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
-[![Coverage report](https://git.duniter.org/clients/python/silkaj/badges/dev/coverage.svg)](https://clients.duniter.io/python/silkaj/index.html)
+[![Coverage report](https://git.duniter.org/clients/python/silkaj/badges/main/coverage.svg)](https://clients.duniter.io/python/silkaj/index.html)
 [![Website](https://img.shields.io/website/https/silkaj.duniter.org.svg)](https://silkaj.duniter.org)
-[![Dev pipeline status](https://git.duniter.org/clients/python/silkaj/badges/dev/pipeline.svg)](https://git.duniter.org/clients/python/silkaj/)
+[![Dev pipeline status](https://git.duniter.org/clients/python/silkaj/badges/main/pipeline.svg)](https://git.duniter.org/clients/python/silkaj/)
 
 Powerfull, lightweight, and multi-platform command line client written with Python for Äž1 and Äž1-Test currencies
 - [Website](https://silkaj.duniter.org)
diff --git a/pyproject.toml b/pyproject.toml
index 8ab5173c..408fc06a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -8,8 +8,8 @@ readme = "README.md"
 license = "AGPL-3.0-or-later"
 homepage =  "https://silkaj.duniter.org"
 repository = "https://git.duniter.org/clients/python/silkaj"
-documentation = "https://git.duniter.org/clients/python/silkaj/tree/dev/doc"
-urls = { Changelog = "https://git.duniter.org/clients/python/silkaj/-/blob/dev/CHANGELOG.md" }
+documentation = "https://git.duniter.org/clients/python/silkaj/tree/main/doc"
+urls = { Changelog = "https://git.duniter.org/clients/python/silkaj/-/blob/main/CHANGELOG.md" }
 keywords = ["g1", "duniter", "cryptocurrency", "librecurrency", "RTM"]
 include = ["g1_monetary_license/g1_monetary_license_*.rst"]
 
diff --git a/release.sh b/release.sh
index 4a1b9971..5cd53084 100755
--- a/release.sh
+++ b/release.sh
@@ -16,8 +16,8 @@ check_version_format() {
 
 check_branch() {
 	branch=`git rev-parse --abbrev-ref HEAD`
-	if [[ "$branch" != "master" ]]; then
-		error_message "Current branch should be 'master'"
+	if [[ "$branch" != "main" ]]; then
+		error_message "Current branch should be 'main'"
 	fi
 }
 
@@ -46,6 +46,6 @@ error_message() {
 
 check_argument_specified
 check_version_format
-#check_branch
+check_branch
 update_version
 commit_tag
diff --git a/release_notes/v0.8.md b/release_notes/v0.8.md
index 8c8e4a9a..9f44c214 100644
--- a/release_notes/v0.8.md
+++ b/release_notes/v0.8.md
@@ -3,7 +3,7 @@
 ## Introduction
 The Silkaj team is pleased to announce the release of Silkaj 0.8.0. A new team member joined us at the beginning of this development cycle: Matograine. We highly appreciate his commitment, his improvements of the transaction code and his work on the checksum.
 This release comes along with a number of new features and improvements.
-The most important of them are highlighted in this article, if you are looking for a comprehensive list of changes, check out the [changelog](https://git.duniter.org/clients/python/silkaj/blob/dev/CHANGELOG.md).
+The most important of them are highlighted in this article, if you are looking for a comprehensive list of changes, check out the [changelog](https://git.duniter.org/clients/python/silkaj/blob/main/CHANGELOG.md).
 
 Version 0.8.0 was done in 145 commits, and features seven major improvements:
 1. `membership`: We developed a command to allow users to send membership documents.
@@ -180,7 +180,7 @@ We migrated the packaging and the dependency management tool from Pipenv to Poet
 
 In comparison, [Poetry](https://python-poetry.org/) is a well thought and stable tool which has been released by the end of 2019. In the former development environment, we had to define the dependencies twice in the `requirements.txt`, `setup.{py,cfg}`, `Pipenv` files. Poetry, however, supports the `pyproject.toml` file standardized by the Python project and is able to define the dependencies at once.
 
-If you would like to install Silkaj for development purposes, please follow [this tutorial](https://git.duniter.org/clients/python/silkaj/-/blob/dev/doc/install_poetry.md). You may also interested by checking the newly introduced [contribution process documentation `CONTRIBUTING.md`](https://git.duniter.org/clients/python/silkaj/-/blob/dev/CONTRIBUTING.md).
+If you would like to install Silkaj for development purposes, please follow [this tutorial](https://git.duniter.org/clients/python/silkaj/-/blob/main/doc/install_poetry.md). You may also interested by checking the newly introduced [contribution process documentation `CONTRIBUTING.md`](https://git.duniter.org/clients/python/silkaj/-/blob/main/CONTRIBUTING.md).
 
 ### B. Automatic container generation
 We set up an [automated pipeline to generate containers](https://git.duniter.org/docker/python3/poetry/) for all supported Python versions: 3.5, 3.6, 3.7, and 3.8. These containers are based on official Python containers, which use Debian Buster Slim. On top of that, Poetry, `libsodium`, and other development tools are installed to continually check and test Silkaj in its pipeline. Since DuniterPy uses the same containers, it also profits from this automated container generation.
diff --git a/release_notes/v0.9.0rc.md b/release_notes/v0.9.0rc.md
index ebe71dd3..a4a7429f 100644
--- a/release_notes/v0.9.0rc.md
+++ b/release_notes/v0.9.0rc.md
@@ -8,7 +8,7 @@ To install this pre-release version from PyPI, use this command:
 ```sh
 pip3 install silkaj --user --upgrade --pre
 ```
-Please test it globally, and check [the changelog](https://git.duniter.org/clients/python/silkaj/-/blob/dev/CHANGELOG.md#v090rc-24th-march-2021) which contains the changes which happen during this development cycle.
+Please test it globally, and check [the changelog](https://git.duniter.org/clients/python/silkaj/-/blob/main/CHANGELOG.md#v090rc-24th-march-2021) which contains the changes which happen during this development cycle.
 Pay a special attention to the transaction part where a part of the algorithm changed.
 There are new options on following commands:
 ```sh
diff --git a/release_notes/v0.9.md b/release_notes/v0.9.md
index 14aff894..eaf67cc3 100644
--- a/release_notes/v0.9.md
+++ b/release_notes/v0.9.md
@@ -2,7 +2,7 @@
 
 ## Introduction
 The Silkaj team is pleased to announce the release of Silkaj 0.9.0.
-The most important changes are highlighted in this article, if you are looking for a comprehensive list of changes, check out the [changelog](https://git.duniter.org/clients/python/silkaj/blob/dev/CHANGELOG.md).
+The most important changes are highlighted in this article, if you are looking for a comprehensive list of changes, check out the [changelog](https://git.duniter.org/clients/python/silkaj/blob/main/CHANGELOG.md).
 
 #### Transaction
 Silkaj is now properly handling the transaction document size limit.
-- 
GitLab