build-snapshot.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. ---
  2. name: "Build Snapshot"
  3. on:
  4. push:
  5. pull_request:
  6. workflow_dispatch:
  7. jobs:
  8. build-snapshot:
  9. runs-on: ubuntu-latest
  10. if: github.ref_type != 'tag'
  11. steps:
  12. - name: Checkout
  13. uses: actions/checkout@v4
  14. with:
  15. fetch-depth: 0
  16. - name: Set up QEMU
  17. id: qemu
  18. uses: docker/setup-qemu-action@v3
  19. with:
  20. image: tonistiigi/binfmt:latest
  21. platforms: arm64,arm
  22. - name: Setup node
  23. uses: actions/setup-node@v4
  24. with:
  25. cache: 'npm'
  26. cache-dependency-path: webui.dev/package-lock.json
  27. - name: Setup Go
  28. uses: actions/setup-go@v5
  29. with:
  30. go-version-file: 'service/go.mod'
  31. cache: true
  32. cache-dependency-path: 'service/go.mod'
  33. - name: Print go version
  34. run: go version
  35. - name: make service
  36. run: make -w service
  37. - name: make webui
  38. run: make -w webui-dist
  39. - name: unit tests
  40. run: make -w service-unittests
  41. - name: integration tests
  42. run: cd integration-tests && make -w
  43. - name: goreleaser
  44. uses: goreleaser/goreleaser-action@v6
  45. with:
  46. distribution: goreleaser
  47. version: latest
  48. args: release --snapshot --clean --parallelism 1 --skip=docker
  49. - name: get date
  50. run: |
  51. echo "DATE=$(date +'%Y-%m-%d')" >> "$GITHUB_ENV"
  52. - name: Archive binaries
  53. uses: actions/upload-artifact@v4.3.1
  54. with:
  55. name: "OliveTin-snapshot-${{ env.DATE }}-${{ github.sha }}"
  56. path: dist/OliveTin*.*
  57. - name: Archive integration tests
  58. uses: actions/upload-artifact@v4.3.1
  59. if: always()
  60. with:
  61. name: "OliveTin-integration-tests-${{ env.DATE }}-${{ github.sha }}"
  62. path: |
  63. integration-tests
  64. !integration-tests/node_modules