Parcourir la source

Merge branch 'pkging' into 0install_script

pkging stands for packaging.

 Conflicts:
	CHANGELOG.md
	setup.data
	src/oclaunch.ml

Setup.data was removed since it create build probelms on other computers.
CHANGELOG just kept the two parts.
Oclaunch.ml file got some code to get execution time.
Leo il y a 9 ans
Parent
commit
64f2b1a5b9
7 fichiers modifiés avec 81 ajouts et 9 suppressions
  1. 3 0
      CHANGELOG.md
  2. 6 0
      CONTRIBUTING.md
  3. 22 0
      code_of_conduct.md
  4. 12 6
      pkg.sh
  5. 11 3
      release.sh
  6. 18 0
      sign-dist.sh
  7. 9 0
      src/oclaunch.ml

+ 3 - 0
CHANGELOG.md

@@ -17,6 +17,9 @@
    + More natural behavior when starting from an empty file. (Don't increment
      number of launch when nothing is actually launched)
    + For the futur : Running infinite, daemon mode...
+ + Improve release script, to enhance contributing experience (making easier to
+   release source-code, binaries, signing…). TODO Merge name format of
+   Oinstall.sh and pkg.sh
 
 ## 0.2.x
 

+ 6 - 0
CONTRIBUTING.md

@@ -0,0 +1,6 @@
+# Contributions are most welcome, not only for the code !
+
+See [the website](http://oclaunch.tuxfamily.org/contribute.html) for details.
+
+By participating in this project you agree to abide by its
+[terms](oclaunch.tuxfamily.org/rules.html).

+ 22 - 0
code_of_conduct.md

@@ -0,0 +1,22 @@
+# Contributor Code of Conduct
+
+As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
+
+We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery
+* Personal attacks
+* Trolling or insulting/derogatory comments
+* Public or private harassment
+* Publishing other's private information, such as physical or electronic addresses, without explicit permission
+* Other unethical or unprofessional conduct.
+
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
+
+This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
+
+This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)

+ 12 - 6
pkg.sh

@@ -4,15 +4,21 @@
 echo "Start"
 
 # If directory doesn't exist, create it
-if ! [[ -e dist ]]; then
+if ! [ -e dist ]; then
     mkdir dist
 fi
 
 # If no tag, use commit SHA1
-tag=`git tag --points-at HEAD`
-id=`git rev-parse --short --verify HEAD`
-name=OcLaunch_${tag}-${id}.tgz
+id=`git describe --abbrev=40 --candidates=50 HEAD`
+name=OcLaunch_${id}
 
-echo "Write in" $name
-git archive master --prefix=${name}/ --format=tgz -o dist/$name
+echo "Writing in" $name".*"
+git archive HEAD --prefix=${name}/ --format=tar.gz -o dist/${name}.tar.gz -9
+git archive HEAD --prefix=${name}/ --format=zip -o dist/${name}.zip -9
+# Creating .xz and .bz2 from tar archive
+tar_name=${name}.tar
+git archive HEAD --prefix=${name}/ --format=tar -o dist/${tar_name}
+cd dist
+bzip2 -c9 < ${tar_name} >  ${tar_name}.bz2
+xz -c9 < ${tar_name} >  ${tar_name}.xz
 

+ 11 - 3
release.sh

@@ -7,8 +7,16 @@
 
 # Record changes
 git commit -a -m "Version $(cat ./VERSION)"
-git tag -s v$(cat VERSION) -m "Release $(cat VERSION)"
+git tag -s v$(cat VERSION) -m "Release version $(cat VERSION)"
 
-# Cleanup dist directory to put the new archives
-rm -r dist/*
+# Cleanup dist directory to put the new archives, if exists
+if [ -d dist ]; then
+  rm -r dist/*
+fi
+# Binary archives
 ./0install.sh
+# Source code
+./pkg.sh
+
+# Signing everything
+./sign-dist.sh

+ 18 - 0
sign-dist.sh

@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Script used to sign (almost) everything in the dist folder
+
+if [ ! -d dist ]; then
+  mkdir dist
+fi
+cd dist
+# File to signed
+# MEMO: -e: regexp, -v: not matched
+tobe_sig=$(ls | grep -e ".tar" -e ".zip" -v ".sig")
+
+for element in ${tobe_sig}
+do
+  echo "Signing" ${element}
+  gpg --detach-sign ${element}
+done
+

+ 9 - 0
src/oclaunch.ml

@@ -46,6 +46,10 @@ let version_number = "0.3.1-dev";;
 let build_info = ( "Build with OCaml version " ^ (Sys.ocaml_version) ^ " on " ^ (Sys.os_type) );;
 
 let () =
+  (* Store begin time *)
+  let start = Time.(now () |> to_float) in
+
+  (* Running commands *)
   Command.run ~version:version_number ~build_info:build_info
   Command_def.commands;
 
@@ -58,6 +62,11 @@ let () =
       | Free -> ()
       | Error -> Messages.warning "Error with lockfile"
   ));
+
+  (* Display total running time, to float is a number of secconds *)
+  Messages.debug Time.(now () |> to_float |> (-.) start |> ( *. ) (-1.)
+  |> sprintf "Runned during %f second(s)");
+
   (* Reset display *)
   Messages.reset ()
 ;;