Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

snapcraft.yaml 2.4KB

Add logic to build stable and edge builds (#12052) This adds some logic to enable the snapcraft builds of the gitea snap to create both builds of the latest tip of master for edge channels, and stable releases. The logic simply looks for a new upstream release in github, and if that latest tagged release is not the same as the release in the candidate channel in the snap store, then it must be new, and so we checkout that tag and build that. If the current released tag is the same as what's in candidate, we build whatever is in git master. The process for using this is: Initially: When this lands, it will build the latest stable release of gitea and push to the edge channel in the snap store. Someone on the release team can go to https://snapcraft.io/gitea/releases and release that build to stable and candidate. Ongoing: The next build to be triggered will be a git master build, and can just sit in edge, nothing for the release team to do. On new release: The next build triggered will contain the stable release, and will be published to edge. Someone on the release team can login to the above URL and release that again to stable & candidate. Alternatively they can release to candidate, do some additional testing on that release before releasing to stable. Hope that all makes sense. Questions / comments welcome. I'm super keen to see stable releases of Gitea in the stable channel of the Snap Store. I'd like to promote it but I can't really until it's in stable. Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 år sedan
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. name: gitea
  2. summary: Gitea - A painless self-hosted Git service
  3. description: |
  4. The goal of this project is to make the easiest, fastest, and most painless
  5. way of setting up a self-hosted Git service. With Go, this can be done with
  6. an independent binary distribution across ALL platforms that Go supports,
  7. including Linux, Mac OS X, Windows and ARM.
  8. icon: public/img/logo.png
  9. confinement: strict
  10. base: core18
  11. adopt-info: gitea
  12. architectures:
  13. - build-on: armhf
  14. - build-on: amd64
  15. - build-on: arm64
  16. environment:
  17. GITEA_CUSTOM: "$SNAP_COMMON"
  18. GITEA_WORK_DIR: "$SNAP_COMMON"
  19. GIT_TEMPLATE_DIR: "$SNAP/usr/share/git-core/templates"
  20. GIT_EXEC_PATH: "$SNAP/usr/lib/git-core"
  21. apps:
  22. gitea:
  23. command: gitea
  24. plugs: [network, network-bind]
  25. web:
  26. command: gitea web
  27. daemon: simple
  28. plugs: [network, network-bind]
  29. dump:
  30. command: gitea dump
  31. plugs: [home]
  32. version:
  33. command: gitea --version
  34. sqlite:
  35. command: usr/bin/sqlite3
  36. parts:
  37. gitea:
  38. plugin: make
  39. source: .
  40. stage-packages: [ git, sqlite3, openssh-client ]
  41. build-packages: [ git, libpam0g-dev, libsqlite3-dev]
  42. build-snaps: [ go, node/14/stable ]
  43. build-environment:
  44. - LDFLAGS: ""
  45. override-pull: |
  46. snapcraftctl pull
  47. last_committed_tag="$(git for-each-ref --sort=taggerdate --format '%(tag)' refs/tags | tail -n 1)"
  48. last_released_tag="$(snap info gitea | awk '$1 == "latest/candidate:" { print $2 }')"
  49. # If the latest tag from the upstream project has not been released to
  50. # stable, build that tag instead of master.
  51. if [ "${last_committed_tag}" != "${last_released_tag}" ]; then
  52. git fetch
  53. git checkout "${last_committed_tag}"
  54. fi
  55. version="$(git describe --always | sed -e 's/-/+git/;y/-/./')"
  56. [ -n "$(echo $version | grep "+git")" ] && grade=devel || grade=stable
  57. snapcraftctl set-version "$version"
  58. snapcraftctl set-grade "$grade"
  59. override-build: |
  60. set -x
  61. TAGS="bindata sqlite sqlite_unlock_notify pam cert" make build
  62. install -D gitea "${SNAPCRAFT_PART_INSTALL}/gitea"
  63. cp -r options "${SNAPCRAFT_PART_INSTALL}/"
  64. prime:
  65. - -etc
  66. - -usr/lib/systemd
  67. - -usr/lib/gcc
  68. - -usr/lib/sasl2
  69. - -usr/lib/x86_64-linux-gnu/krb5
  70. - -usr/share/apport
  71. - -usr/share/bash-completion
  72. - -usr/share/git-core/contrib
  73. - -usr/share/man
  74. - -usr/share/upstart
  75. - -var