build 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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/browser-android-armv7") -%]
  8. mv [% c('input_files_by_name/android-armv7') %]/* "$destdir"/
  9. [% END -%]
  10. [% IF c("var/browser-android-x86") -%]
  11. mv [% c('input_files_by_name/android-x86') %]/* "$destdir"/
  12. [% END -%]
  13. [% IF c("var/browser-android-x86_64") -%]
  14. mv [% c('input_files_by_name/android-x86_64') %]/* "$destdir"/
  15. [% END -%]
  16. [% IF c("var/browser-android-aarch64") -%]
  17. mv [% c('input_files_by_name/android-aarch64') %]/* "$destdir"/
  18. [% END -%]
  19. [% IF c("var/browser-windows-i686") -%]
  20. mv [% c('input_files_by_name/windows-i686') %]/* "$destdir"/
  21. [% END -%]
  22. [% IF c("var/browser-windows-x86_64") -%]
  23. mv [% c('input_files_by_name/windows-x86_64') %]/* "$destdir"/
  24. [% END -%]
  25. [% IF c("var/browser-macos") -%]
  26. mv [% c('input_files_by_name/macos') %]/* "$destdir"/
  27. [% END -%]
  28. [% IF c("var/browser-macos-x86_64") -%]
  29. mv [% c('input_files_by_name/macos-x86_64') %]/* "$destdir"/
  30. [% END -%]
  31. [% IF c("var/browser-macos-aarch64") -%]
  32. mv [% c('input_files_by_name/macos-aarch64') %]/* "$destdir"/
  33. [% END -%]
  34. [% IF c("var/browser-linux-i686") -%]
  35. mv [% c('input_files_by_name/linux-i686') %]/* "$destdir"/
  36. [% END -%]
  37. [% IF c("var/browser-linux-x86_64") -%]
  38. mv [% c('input_files_by_name/linux-x86_64') %]/* "$destdir"/
  39. [% END -%]
  40. [% IF c("var/browser-src") -%]
  41. mv [% c('input_files_by_name/src-firefox') %] \
  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. # empty any existing sh256sums file
  53. echo -n > sha256sums-unsigned-build.txt
  54. # concat sha256sum entry for each file in set
  55. for i in $(ls -1 *.exe *.tar.xz *.dmg *.mar *.zip *.tar.gz *.apk *.json | grep -v '\.incremental\.mar$' | sort)
  56. do
  57. sha256sum $i >> sha256sums-unsigned-build.txt
  58. done
  59. [% IF c("var/sign_build") -%]
  60. gpg -abs [% c("var/sign_build_gpg_opts") %] sha256sums-unsigned-build.txt
  61. [% END -%]
  62. cat sha256sums-unsigned-build.txt