build 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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-armhf") -%]
  31. mv [% c('input_files_by_name/linux-armhf') %]/* "$destdir"/
  32. [% END -%]
  33. [% IF c("var/torbrowser-linux-arm64") -%]
  34. mv [% c('input_files_by_name/linux-arm64') %]/* "$destdir"/
  35. [% END -%]
  36. [% IF c("var/torbrowser-linux-i686") -%]
  37. mv [% c('input_files_by_name/linux-i686') %]/* "$destdir"/
  38. [% END -%]
  39. [% IF c("var/torbrowser-linux-x86_64") -%]
  40. mv [% c('input_files_by_name/linux-x86_64') %]/* "$destdir"/
  41. [% END -%]
  42. [% IF c("var/torbrowser-src") -%]
  43. mv [% c('input_files_by_name/src-firefox') %] \
  44. [% c('input_files_by_name/src-tor-launcher') %] \
  45. "$destdir"/
  46. [% END -%]
  47. cd "$destdir"
  48. cat > .htaccess <<EOF
  49. RewriteEngine On
  50. RewriteRule ^sha256sums.txt$ sha256sums-unsigned-build.txt
  51. RewriteRule ^sha256sums.txt.asc$ sha256sums-unsigned-build.txt.asc
  52. RewriteRule ^sha256sums.incrementals.txt$ sha256sums-unsigned-build.incrementals.txt
  53. RewriteRule ^sha256sums.incrementals.txt.asc$ sha256sums-unsigned-build.incrementals.txt.asc
  54. EOF
  55. sha256sum $(ls -1 *.exe *.tar.xz *.dmg *.mar *.zip *.tar.gz *.apk | grep -v '\.incremental\.mar$' | sort) > sha256sums-unsigned-build.txt
  56. [% IF c("var/sign_build") -%]
  57. gpg -abs [% c("var/sign_build_gpg_opts") %] sha256sums-unsigned-build.txt
  58. [% END -%]
  59. cat sha256sums-unsigned-build.txt