2
0

build.yml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. name: Build and Distribute
  2. on:
  3. pull_request:
  4. push:
  5. branches:
  6. - release
  7. - master
  8. paths:
  9. - "**"
  10. workflow_dispatch:
  11. concurrency:
  12. group: ${{ github.head_ref || github.ref }}
  13. jobs:
  14. deb:
  15. name: 'DEB'
  16. permissions:
  17. id-token: write
  18. contents: read
  19. uses: signalwire/actions-template/.github/workflows/cicd-docker-build-and-distribute.yml@main
  20. strategy:
  21. # max-parallel: 1
  22. fail-fast: false
  23. matrix:
  24. os:
  25. - debian
  26. version:
  27. - bookworm
  28. - bullseye
  29. platform:
  30. - name: amd64
  31. runner: ubuntu-latest
  32. - name: arm32v7
  33. runner: ubuntu-latest
  34. - name: arm64v8
  35. runner: ubuntu-latest
  36. with:
  37. RUNNER: ${{ matrix.platform.runner }}
  38. ARTIFACTS_PATTERN: '.*\.(deb)$'
  39. DOCKERFILE: .github/docker/${{ matrix.os }}/${{ matrix.version }}/${{ matrix.platform.name }}/Dockerfile
  40. MAINTAINER: 'Andrey Volk <andrey@signalwire.com>'
  41. META_FILE_PATH_PREFIX: /var/www/libks/public/unstable/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}
  42. PLATFORM: ${{ matrix.platform.name }}
  43. TARGET_ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-unstable-artifact
  44. UPLOAD_BUILD_ARTIFACTS: ${{ github.event_name != 'pull_request' }}
  45. secrets:
  46. GH_BOT_DEPLOY_TOKEN: ${{ secrets.PAT }}
  47. HOSTNAME: ${{ secrets.HOSTNAME }}
  48. PROXY_URL: ${{ secrets.PROXY_URL }}
  49. USERNAME: ${{ secrets.USERNAME }}
  50. TELEPORT_TOKEN: ${{ secrets.TELEPORT_TOKEN }}
  51. deb-mirror:
  52. name: 'DEB-MIRROR'
  53. if: ${{ github.event_name != 'pull_request' }}
  54. needs:
  55. - deb
  56. runs-on: ubuntu-latest
  57. permissions:
  58. id-token: write
  59. contents: read
  60. strategy:
  61. # max-parallel: 1
  62. fail-fast: false
  63. matrix:
  64. os:
  65. - debian
  66. version:
  67. - bookworm
  68. - bullseye
  69. platform:
  70. - name: amd64
  71. runner: ubuntu-latest
  72. - name: arm32v7
  73. runner: ubuntu-latest
  74. - name: arm64v8
  75. runner: ubuntu-latest
  76. release:
  77. - release
  78. - unstable
  79. steps:
  80. - name: Checkout reusable actions
  81. uses: actions/checkout@v4
  82. with:
  83. repository: signalwire/actions-template
  84. ref: main
  85. fetch-depth: 1
  86. path: actions
  87. sparse-checkout: |
  88. .github/actions/teleport-local-copy/action.yml
  89. sparse-checkout-cone-mode: false
  90. - name: Mirror artifacts on remote server behind Teleport (public)
  91. uses: ./actions/.github/actions/teleport-local-copy
  92. with:
  93. SRC: '/var/www/libks/public/unstable/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}/${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-unstable-artifact.tar.gz'
  94. DST: '/var/www/libks/public/${{ matrix.release }}/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}/${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-${{ matrix.release }}-artifact.tar.gz'
  95. env:
  96. HOSTNAME: ${{ secrets.HOSTNAME }}
  97. PROXY_URL: ${{ secrets.PROXY_URL }}
  98. TOKEN: ${{ secrets.TELEPORT_TOKEN }}
  99. USERNAME: ${{ secrets.USERNAME }}
  100. - name: Mirror artifacts on remote server behind Teleport (fsa)
  101. uses: ./actions/.github/actions/teleport-local-copy
  102. with:
  103. SRC: '/var/www/libks/public/unstable/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}/${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-unstable-artifact.tar.gz'
  104. DST: '/var/www/libks/fsa/${{ matrix.release }}/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}/${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-fsa-${{ matrix.release }}-artifact.tar.gz'
  105. env:
  106. HOSTNAME: ${{ secrets.HOSTNAME }}
  107. PROXY_URL: ${{ secrets.PROXY_URL }}
  108. TOKEN: ${{ secrets.TELEPORT_TOKEN }}
  109. USERNAME: ${{ secrets.USERNAME }}
  110. meta:
  111. name: 'Publish build data to meta-repo'
  112. if: ${{ github.event_name != 'pull_request' }}
  113. needs:
  114. - deb
  115. - deb-mirror
  116. permissions:
  117. id-token: write
  118. contents: read
  119. uses: signalwire/actions-template/.github/workflows/meta-repo-content.yml@main
  120. with:
  121. META_CONTENT: '/var/www/libks/{fsa,public}/{release,unstable}/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}'
  122. META_REPO: signalwire/bamboo_gha_trigger
  123. META_REPO_BRANCH: trigger/libks/${{ github.ref_name }}
  124. secrets:
  125. GH_BOT_DEPLOY_TOKEN: ${{ secrets.PAT }}