From 8842d115ec8a8120d0b2a6b5151acdc0c2296b92 Mon Sep 17 00:00:00 2001 From: Awiteb Date: Thu, 18 Jul 2024 17:44:06 +0300 Subject: [PATCH 1/4] feat: Just task to create `CONTRIBUTORS.md` file Signed-off-by: Awiteb --- Justfile | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Justfile b/Justfile index 0af9ced..5a25e86 100644 --- a/Justfile +++ b/Justfile @@ -33,5 +33,41 @@ run: docker-compose up -d db RUST_LOG=debug cargo run -p oxidetalis -- --config config.toml +# Generate the contributors list from the git log +# then add it to the CONTRIBUTORS file +contributors: + #! /bin/env bash + maintainers="- Awiteb \n- Amjad Alsharafi " + reviewers=`git log --pretty=format:"%b" | grep -i "Reviewed-by" | sed 's/Reviewed-by: /- /' | sort | uniq` + reporters=`git log --pretty=format:"%b" | grep -i "Reported-by" | sed 's/Reported-by: /- /' | sort | uniq` + suggesters=`git log --pretty=format:"%b" | grep -i "Suggested-by" | sed 's/Suggested-by: /- /' | sort | uniq` + helpers=`git log --pretty=format:"%b" | grep -i "Helped-by" | sed 's/Helped-by: /- /' | sort | uniq` + authors=`git log --pretty=format:"- %an <%ae>" | sort | uniq | grep -v "actions"` + co_authors=`git log --pretty=format:"%b" | grep -i "Co-authored-by" | sed 's/Co-authored-by: /- /' | sort | uniq` + contributors_count=`echo -e "${maintainers}\n${authors}\n${co_authors}\n${reviewers}\n${reporters}\n${suggesters}\n${helpers}" | grep -Ev '^$' | sort | uniq | wc -l` + footer="Oxidetalis Homeserver currently has ${contributors_count} contributors!\n\nInterested in becoming a contributor? Read the [CONTRIBUTING.md](CONTRIBUTING.md) file to get started." + + file="# Contributors\nA heartfelt thank you to all the contributors who have helped make Oxidetalis Homeserver better. Below is a list of the contributors who have played a crucial role in the development and improvement of the Oxidetalis Homeserver.\n\n## Maintainers\nMaintainers are responsible for overseeing the project, keeping it up to date, and ensuring it runs smoothly.\n\n${maintainers}" + if [ -n "$authors" ]; then + file="${file}\n\n## Code Authors\nCode authors have written the code for the project.\n\n${authors}" + fi + if [ -n "$co_authors" ]; then + file="${file}\n${co_authors}" + fi + if [ -n "$reviewers" ]; then + file="${file}\n\n## Reviewers\nCode reviewers have reviewed the code and provided feedback, suggestions, and improvements.\n\n${reviewers}" + fi + if [ -n "$reporters" ]; then + file="${file}\n\n## Bug Reporters\nBug reporters have identified and reported bugs in the project, helping to improve its quality.\n\n${reporters}" + fi + if [ -n "$suggesters" ]; then + file="${file}\n\n## Feature Suggesters\nFeature suggesters have proposed new features to enhance the project.\n\n${suggesters}" + fi + if [ -n "$helpers" ]; then + file="${file}\n\n## Helpers\nHelpers have contributed in various ways that do not involve writing code, such as providing feedback, suggestions, and improvements.\n\n${helpers}" + fi + file="${file}\n\n---\n${footer}" + echo -e "${file}" | fmt -sw 80 > "CONTRIBUTORS.md" + [private] alias r := run -- 2.45.2 From bb66f4d71bd60d579c48eecc3296fbefbcf9c9f7 Mon Sep 17 00:00:00 2001 From: Awiteb Date: Sat, 20 Jul 2024 15:57:10 +0300 Subject: [PATCH 2/4] chore: Fix typos Signed-off-by: Awiteb --- Justfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Justfile b/Justfile index 5a25e86..b2bb9cf 100644 --- a/Justfile +++ b/Justfile @@ -5,7 +5,7 @@ # - just (Of course) # - cargo (For the build and tests) -set shell := ["/usr/bin/bash", "-c"] +set shell := ["/usr/bin/env", "bash", "-c"] JUST_EXECUTABLE := "just -u -f " + justfile() header := "Available tasks:\n" @@ -36,7 +36,7 @@ run: # Generate the contributors list from the git log # then add it to the CONTRIBUTORS file contributors: - #! /bin/env bash + #! /usr/bin/env bash maintainers="- Awiteb \n- Amjad Alsharafi " reviewers=`git log --pretty=format:"%b" | grep -i "Reviewed-by" | sed 's/Reviewed-by: /- /' | sort | uniq` reporters=`git log --pretty=format:"%b" | grep -i "Reported-by" | sed 's/Reported-by: /- /' | sort | uniq` @@ -47,9 +47,9 @@ contributors: contributors_count=`echo -e "${maintainers}\n${authors}\n${co_authors}\n${reviewers}\n${reporters}\n${suggesters}\n${helpers}" | grep -Ev '^$' | sort | uniq | wc -l` footer="Oxidetalis Homeserver currently has ${contributors_count} contributors!\n\nInterested in becoming a contributor? Read the [CONTRIBUTING.md](CONTRIBUTING.md) file to get started." - file="# Contributors\nA heartfelt thank you to all the contributors who have helped make Oxidetalis Homeserver better. Below is a list of the contributors who have played a crucial role in the development and improvement of the Oxidetalis Homeserver.\n\n## Maintainers\nMaintainers are responsible for overseeing the project, keeping it up to date, and ensuring it runs smoothly.\n\n${maintainers}" + file="# Contributors\nA heartfelt thank you to all the contributors who have helped make Oxidetalis Homeserver better. Below is a list of the contributors who have played a crucial role in the development and improvement of Oxidetalis Homeserver.\n\n## Maintainers\nMaintainers are responsible for overseeing Oxidetalis, keeping it up to date, and ensuring it runs smoothly.\n\n${maintainers}" if [ -n "$authors" ]; then - file="${file}\n\n## Code Authors\nCode authors have written the code for the project.\n\n${authors}" + file="${file}\n\n## Code Authors\nCode authors have written the code for Oxidetalis.\n\n${authors}" fi if [ -n "$co_authors" ]; then file="${file}\n${co_authors}" @@ -58,10 +58,10 @@ contributors: file="${file}\n\n## Reviewers\nCode reviewers have reviewed the code and provided feedback, suggestions, and improvements.\n\n${reviewers}" fi if [ -n "$reporters" ]; then - file="${file}\n\n## Bug Reporters\nBug reporters have identified and reported bugs in the project, helping to improve its quality.\n\n${reporters}" + file="${file}\n\n## Bug Reporters\nBug reporters have identified and reported bugs in Oxidetalis, helping to improve its quality.\n\n${reporters}" fi if [ -n "$suggesters" ]; then - file="${file}\n\n## Feature Suggesters\nFeature suggesters have proposed new features to enhance the project.\n\n${suggesters}" + file="${file}\n\n## Feature Suggesters\nFeature suggesters have proposed new features to enhance Oxidetalis.\n\n${suggesters}" fi if [ -n "$helpers" ]; then file="${file}\n\n## Helpers\nHelpers have contributed in various ways that do not involve writing code, such as providing feedback, suggestions, and improvements.\n\n${helpers}" -- 2.45.2 From 4bda036ba7c660bf04985450b39f48eea3e9bd78 Mon Sep 17 00:00:00 2001 From: Awiteb Date: Sat, 20 Jul 2024 15:57:39 +0300 Subject: [PATCH 3/4] feat: Contributors actions Signed-off-by: Awiteb --- .forgejo/workflows/contributors.yml | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .forgejo/workflows/contributors.yml diff --git a/.forgejo/workflows/contributors.yml b/.forgejo/workflows/contributors.yml new file mode 100644 index 0000000..ba64ea7 --- /dev/null +++ b/.forgejo/workflows/contributors.yml @@ -0,0 +1,30 @@ +name: Update Contributors + +on: + push: + branches: [master] + +jobs: + update_contributors: + name: Update Contributors + runs-on: debian + steps: + - uses: actions/checkout@v4 + with: + ref: master + fetch-depth: 0 + - name: Install just + run: | + curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ./bin + - name: Update Contributors + run: | + ./bin/just contributors + if [ -n "$(git status --porcelain)" ]; then + git config user.name forgejo-actions + git config user.email forgejo-actions@noreply.localhost + git add CONTRIBUTORS.md + git commit -m "Update CONTRIBUTORS.md" + git push + else + echo "No changes to CONTRIBUTORS.md" + fi -- 2.45.2 From 3bd87531182ac6c1c5d5a83aed071a55dba9b9af Mon Sep 17 00:00:00 2001 From: Awiteb Date: Sat, 20 Jul 2024 16:04:22 +0300 Subject: [PATCH 4/4] chore: Update README Signed-off-by: Awiteb --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1afd2ae..68a54c8 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ docker-compose up -d ## Contributing For information on how to contribute to the project, please see the -[CONTRIBUTING.md](./CONTRIBUTING.md) file. +[CONTRIBUTING.md](./CONTRIBUTING.md) file. You can see the list of contributors in the [CONTRIBUTORS.md](./CONTRIBUTORS.md) file. ## Repository mirrors - [Codeberg](https://codeberg.org/awiteb/oxidetalis) -- 2.45.2