diff --git a/README.md b/README.md index 07587cc89..1c209312e 100644 --- a/README.md +++ b/README.md @@ -358,7 +358,7 @@ See also the [How To Page](https://ddnexus.github.io/pagy/docs/how-to) ## Top 💯 Contributors -[](https://github.com/ddnexus)[](https://github.com/benkoshy)[](https://github.com/dependabot[bot])[](https://github.com/grosser)[](https://github.com/workgena)[](https://github.com/bquorning)[](https://github.com/molfar)[](https://github.com/sunny)[](https://github.com/enzinia)[](https://github.com/espen)[](https://github.com/berniechiu)[](https://github.com/renshuki)[](https://github.com/wimdavies)[](https://github.com/tiagotex)[](https://github.com/gamafranco)[](https://github.com/thomasklemm)[](https://github.com/tersor)[](https://github.com/simonneutert)[](https://github.com/rainerborene)[](https://github.com/petergoldstein)[](https://github.com/sabljak)[](https://github.com/cseelus)[](https://github.com/ashmaroli)[](https://github.com/747)[](https://github.com/olleolleolle)[](https://github.com/pedrocarmona)[](https://github.com/rafaeelaudibert)[](https://github.com/rafaelmontas)[](https://github.com/yenshirak)[](https://github.com/Tolchi)[](https://github.com/serghost)[](https://github.com/sliminas)[](https://github.com/snkashis)[](https://github.com/artplan1)[](https://github.com/okuramasafumi)[](https://github.com/WilliamHorel)[](https://github.com/woller)[](https://github.com/sk8higher)[](https://github.com/ronald)[](https://github.com/achmiral)[](https://github.com/mauro-ni)[](https://github.com/creativetags)[](https://github.com/mcary)[](https://github.com/marckohlbrugge)[](https://github.com/tr4b4nt)[](https://github.com/tiejianluo)[](https://github.com/szTheory)[](https://github.com/smoothdvd)[](https://github.com/rhodes-david)[](https://github.com/radinreth)[](https://github.com/okliv)[](https://github.com/nedimdz)[](https://github.com/msdundar)[](https://github.com/m-abdurrehman)[](https://github.com/dwieringa)[](https://github.com/jyuvaraj03)[](https://github.com/YutoYasunaga)[](https://github.com/iamyujinwon)[](https://github.com/yhk1038)[](https://github.com/ya-s-u)[](https://github.com/yshmarov)[](https://github.com/thattimc)[](https://github.com/thomaschauffour)[](https://github.com/fluser)[](https://github.com/Federico-G)[](https://github.com/egimenos)[](https://github.com/elliotlarson)[](https://github.com/Earlopain)[](https://github.com/hungdiep97)[](https://github.com/djpremier)[](https://github.com/davidwessman)[](https://github.com/david-a-wheeler)[](https://github.com/MrMoins)[](https://github.com/excid3)[](https://github.com/cellvinchung)[](https://github.com/brunoocasali)[](https://github.com/BrandonKlotz)[](https://github.com/Atul9)[](https://github.com/amenon)[](https://github.com/artinboghosian)[](https://github.com/antonzaharia)[](https://github.com/andrew)[](https://github.com/AbelToy)[](https://github.com/maful)[](https://github.com/loed-idzinga)[](https://github.com/epeirce)[](https://github.com/KevinColemanInc)[](https://github.com/neontuna)[](https://github.com/xuanxu)[](https://github.com/jpgarritano)[](https://github.com/archonic)[](https://github.com/jonasMirendo)[](https://github.com/jivko-chobanov)[](https://github.com/whithajess)[](https://github.com/jesperronn)[](https://github.com/JamesChevalier)[](https://github.com/lazyatom)[](https://github.com/lfidnl)[](https://github.com/Pompeu)[](https://github.com/gnclmorais)[](https://github.com/glenbray)[](https://github.com/tulak) +[](https://github.com/ddnexus)[](https://github.com/benkoshy)[](https://github.com/dependabot[bot])[](https://github.com/grosser)[](https://github.com/workgena)[](https://github.com/bquorning)[](https://github.com/molfar)[](https://github.com/sunny)[](https://github.com/enzinia)[](https://github.com/espen)[](https://github.com/berniechiu)[](https://github.com/renshuki)[](https://github.com/wimdavies)[](https://github.com/tiagotex)[](https://github.com/gamafranco)[](https://github.com/thomasklemm)[](https://github.com/tersor)[](https://github.com/simonneutert)[](https://github.com/rainerborene)[](https://github.com/petergoldstein)[](https://github.com/sabljak)[](https://github.com/cseelus)[](https://github.com/ashmaroli)[](https://github.com/747)[](https://github.com/okuramasafumi)[](https://github.com/olleolleolle)[](https://github.com/pedrocarmona)[](https://github.com/rafaeelaudibert)[](https://github.com/rafaelmontas)[](https://github.com/yenshirak)[](https://github.com/Tolchi)[](https://github.com/serghost)[](https://github.com/sliminas)[](https://github.com/snkashis)[](https://github.com/WilliamHorel)[](https://github.com/woller)[](https://github.com/sk8higher)[](https://github.com/muhammadnawzad)[](https://github.com/ronald)[](https://github.com/achmiral)[](https://github.com/mauro-ni)[](https://github.com/creativetags)[](https://github.com/mcary)[](https://github.com/tulak)[](https://github.com/artplan1)[](https://github.com/tr4b4nt)[](https://github.com/tiejianluo)[](https://github.com/szTheory)[](https://github.com/smoothdvd)[](https://github.com/rhodes-david)[](https://github.com/radinreth)[](https://github.com/okliv)[](https://github.com/nedimdz)[](https://github.com/msdundar)[](https://github.com/m-abdurrehman)[](https://github.com/dwieringa)[](https://github.com/jyuvaraj03)[](https://github.com/YutoYasunaga)[](https://github.com/iamyujinwon)[](https://github.com/yhk1038)[](https://github.com/ya-s-u)[](https://github.com/yshmarov)[](https://github.com/thattimc)[](https://github.com/thomaschauffour)[](https://github.com/Federico-G)[](https://github.com/egimenos)[](https://github.com/elliotlarson)[](https://github.com/Earlopain)[](https://github.com/hungdiep97)[](https://github.com/djpremier)[](https://github.com/davidwessman)[](https://github.com/david-a-wheeler)[](https://github.com/MrMoins)[](https://github.com/excid3)[](https://github.com/cellvinchung)[](https://github.com/brunoocasali)[](https://github.com/BrandonKlotz)[](https://github.com/Atul9)[](https://github.com/amenon)[](https://github.com/artinboghosian)[](https://github.com/antonzaharia)[](https://github.com/andrew)[](https://github.com/AbelToy)[](https://github.com/marckohlbrugge)[](https://github.com/fluser)[](https://github.com/maful)[](https://github.com/loed-idzinga)[](https://github.com/epeirce)[](https://github.com/KevinColemanInc)[](https://github.com/neontuna)[](https://github.com/xuanxu)[](https://github.com/jpgarritano)[](https://github.com/archonic)[](https://github.com/jonasMirendo)[](https://github.com/jivko-chobanov)[](https://github.com/whithajess)[](https://github.com/jesperronn)[](https://github.com/JamesChevalier)[](https://github.com/lazyatom)[](https://github.com/lfidnl)
diff --git a/script/release.sh b/script/release.sh new file mode 100755 index 000000000..600b40885 --- /dev/null +++ b/script/release.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -e + +# Exit if the working tree is dirty +test -n "$(git status --porcelain)" && echo "Working tree dirty!" && exit 1 + +# Exit if is not a releasable branch +[[ "$(git rev-parse --abbrev-ref HEAD)" == master* ]] || echo "Wrong branch to release!" && exit 1 + +# Set the root path +dir="$(dirname -- "$0")" +ROOT="$(cd -P -- "$(dirname -- "$dir")" && printf '%s\n' "$(pwd -P)")" +cd $ROOT + +rake build release + +rm -rfv "$ROOT/pkg" diff --git a/script/update_top100.rb b/script/update_top100.rb index 0d5b5966a..9f2f96d67 100755 --- a/script/update_top100.rb +++ b/script/update_top100.rb @@ -4,26 +4,31 @@ require 'http' require 'net/http' -url_fmt = 'https://api.github.com/repos/ddnexus/pagy/contributors?page=%s' -width = '64' -page = 1 -top100start = '' -top100end = '' +URL_FMT = 'https://api.github.com/repos/ddnexus/pagy/contributors?page=%s' +WIDTH = '60' +MAX_COUNT = 100 +START_TAG = '' +END_TAG = '' +count = 0 +page = 1 -top100 = "#{top100start}\n" -until (contributors = JSON.parse(Net::HTTP.get(URI(format(url_fmt, page))))).empty? +top100 = "#{START_TAG}\n" +until count >= MAX_COUNT || (contributors = JSON.parse(Net::HTTP.get(URI(format(URL_FMT, page))))).empty? contributors.each do |c| + break if count >= MAX_COUNT + commits = c['contributions'] == 1 ? 'commit' : 'commits' - top100 << %([](https://github.com/#{c['login']})) + count += 1 end page += 1 end -top100 << "\n#{top100end}" +top100 << "\n#{END_TAG}" readme_path = File.expand_path('../README.md', __dir__) content = File.read(readme_path) -content.sub!(/#{top100start}.*#{top100end}/m, top100) +content.sub!(/#{START_TAG}.*#{END_TAG}/mo, top100) File.write(readme_path, content) -puts 'Top 100 Contributors README section updated!' +puts %("Top 100 Contributors" README section updated! (#{count}/#{MAX_COUNT})) diff --git a/script/version-bump.sh b/script/version-bump.sh index 183b1be0c..baba58946 100755 --- a/script/version-bump.sh +++ b/script/version-bump.sh @@ -65,15 +65,15 @@ if [[ $input = y ]] || [[ $input = Y ]]; then bundle exec "$ROOT/script/update_top100.rb" fi -# Optional show diff -read -rp 'Do you want to see the diff? (y/n)> ' input -if [[ $input = y ]] || [[ $input = Y ]]; then - git diff -U0 --word-diff=color -fi - -# Optional commit -read -rp 'Do you want to commit the changes? (y/n)> ' input -if [[ $input = y ]] || [[ $input = Y ]]; then - git add -A - git commit -m "Version $new_vers" -fi +## Optional show diff +#read -rp 'Do you want to see the diff? (y/n)> ' input +#if [[ $input = y ]] || [[ $input = Y ]]; then +# git diff -U0 --word-diff=color +#fi +# +## Optional commit +#read -rp 'Do you want to commit the changes? (y/n)> ' input +#if [[ $input = y ]] || [[ $input = Y ]]; then +# git add -A +# git commit -m "Version $new_vers" +#fi