build 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/sh
  2. [% c("var/set_default_env") -%]
  3. # reset HOME which was changed by var/set_default_env, for gpg
  4. [% IF ENV.HOME %]export HOME="[% ENV.HOME %]"[% END %]
  5. destdir="[% dest_dir _ '/' _ c("var/publish_dir") %]"
  6. mkdir -p "$destdir"
  7. [% IF c("var/torbrowser-android-armv7") -%]
  8. mv [% c('input_files_by_name/android-armv7') %]/* "$destdir"/
  9. [% END -%]
  10. [% IF c("var/torbrowser-android-x86") -%]
  11. mv [% c('input_files_by_name/android-x86') %]/* "$destdir"/
  12. [% END -%]
  13. [% IF c("var/torbrowser-android-x86_64") -%]
  14. mv [% c('input_files_by_name/android-x86_64') %]/* "$destdir"/
  15. [% END -%]
  16. [% IF c("var/torbrowser-android-aarch64") -%]
  17. mv [% c('input_files_by_name/android-aarch64') %]/* "$destdir"/
  18. [% END -%]
  19. [% IF c("var/torbrowser-windows-i686") -%]
  20. mv [% c('input_files_by_name/windows-i686') %]/* "$destdir"/
  21. mv [% c('input_files_by_name/windows-expert-bundle') %]/* "$destdir"/
  22. [% END -%]
  23. [% IF c("var/torbrowser-windows-x86_64") -%]
  24. mv [% c('input_files_by_name/windows-x86_64') %]/* "$destdir"/
  25. mv [% c('input_files_by_name/windows64-expert-bundle') %]/* "$destdir"/
  26. [% END -%]
  27. [% IF c("var/torbrowser-osx-x86_64") -%]
  28. mv [% c('input_files_by_name/osx-x86_64') %]/* "$destdir"/
  29. [% END -%]
  30. [% IF c("var/torbrowser-linux-i686") -%]
  31. mv [% c('input_files_by_name/linux-i686') %]/* "$destdir"/
  32. [% END -%]
  33. [% IF c("var/torbrowser-linux-x86_64") -%]
  34. mv [% c('input_files_by_name/linux-x86_64') %]/* "$destdir"/
  35. [% END -%]
  36. [% IF c("var/torbrowser-linux-arm") -%]
  37. mv [% c('input_files_by_name/linux-arm') %]/* "$destdir"/
  38. [% END -%]
  39. [% IF c("var/torbrowser-src") -%]
  40. mv [% c('input_files_by_name/src-firefox') %] \
  41. [% c('input_files_by_name/src-tor-launcher') %] \
  42. "$destdir"/
  43. [% END -%]
  44. cd "$destdir"
  45. cat > .htaccess <<EOF
  46. RewriteEngine On
  47. RewriteRule ^sha256sums.txt$ sha256sums-unsigned-build.txt
  48. RewriteRule ^sha256sums.txt.asc$ sha256sums-unsigned-build.txt.asc
  49. RewriteRule ^sha256sums.incrementals.txt$ sha256sums-unsigned-build.incrementals.txt
  50. RewriteRule ^sha256sums.incrementals.txt.asc$ sha256sums-unsigned-build.incrementals.txt.asc
  51. EOF
  52. sha256sum $(ls -1 *.exe *.tar.xz *.dmg *.mar *.zip *.tar.gz *.apk *.json | grep -v '\.incremental\.mar$' | sort) > sha256sums-unsigned-build.txt
  53. [% IF c("var/sign_build") -%]
  54. gpg -abs [% c("var/sign_build_gpg_opts") %] sha256sums-unsigned-build.txt
  55. [% END -%]
  56. cat sha256sums-unsigned-build.txt