From 95dbae83c22412b12fbf538aba55e814cce9df6a Mon Sep 17 00:00:00 2001 From: s3rj1k Date: Fri, 26 Jan 2024 17:57:42 +0100 Subject: [PATCH] TEST --- .github/workflows/build.yml | 115 ++++++++++++++++++++++++++++++++++-- 1 file changed, 110 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index abc084a..35d07c2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,10 +14,24 @@ on: concurrency: group: ${{ github.head_ref || github.ref }} +# TEST2 + jobs: + build_rpm: + name: 'Build RPM' + uses: s3rj1k/actions-template/.github/workflows/ci-rpm-packages.yml@CMake_RPM + with: + PROJECT_NAME: libks + RUNNER: ubuntu-latest + PACKAGER: 'packager Andrey Volk ' + PLATFORM: amd64 + USE_CMAKE: true + CMAKE_BUILD_TYPE: 'Debug' + secrets: inherit + build_deb: name: 'Build DEB' - uses: signalwire/actions-template/.github/workflows/ci-deb-packages-v2.yml@main + uses: s3rj1k/actions-template/.github/workflows/ci-deb-packages-v2.yml@CMake_RPM strategy: fail-fast: false matrix: @@ -38,6 +52,23 @@ jobs: USE_CMAKE: true CMAKE_BUILD_TYPE: 'Debug' + generate_meta_rpm: + if: (github.ref_type == 'branch' && github.base_ref == '') + name: 'Meta RPM' + needs: [ build_rpm ] + strategy: + matrix: + os: + - rpm + platform: + - amd64 + uses: s3rj1k/actions-template/.github/workflows/ci-libs-metadata-v2.yml@CMake_RPM + with: + ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.platform }}-artifact + OS_PLATFORM: ${{ matrix.os }}-${{ matrix.platform }} + RUNNER: ubuntu-latest + FILE_PATH_PREFIX: /var/www/libks-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.platform }}/${{ github.run_id }}-${{ github.run_number }} + generate_meta_deb: if: (github.ref_type == 'branch' && github.base_ref == '') name: 'Meta DEB' @@ -54,13 +85,38 @@ jobs: platform: - amd64 - armhf - uses: signalwire/actions-template/.github/workflows/ci-libs-metadata-v2.yml@main + uses: s3rj1k/actions-template/.github/workflows/ci-libs-metadata-v2.yml@CMake_RPM with: ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.codename }}-${{ matrix.platform }}-artifact OS_PLATFORM: ${{ matrix.os }}-${{ matrix.codename }}-${{ matrix.platform }} RUNNER: ubuntu-latest FILE_PATH_PREFIX: /var/www/libks-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.platform }}/${{ github.run_id }}-${{ github.run_number }} + distribute_matrix_rpm: + if: (github.ref_type == 'branch' && github.base_ref == '') + permissions: write-all + name: 'Copy to remote RPM' + needs: [ build_rpm ] + strategy: + matrix: + os: + - rpm + platform: + - amd64 + uses: s3rj1k/actions-template/.github/workflows/cd-scp.yml@CMake_RPM + with: + ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.platform }}-artifact + TARGET_FOLDER: /var/www/libks-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.platform }}/${{ github.run_id }}-${{ github.run_number }} + RUNNER: ubuntu-latest + FILES: '*.tar.gz' + CREATE_DESTINATION_FOLDERS: true + secrets: + # Explicit define secrets for better understanding but it could be just inherit + PROXY_URL: ${{ secrets.PROXY_URL }} + USERNAME: ${{ secrets.USERNAME }} + HOSTNAME: ${{ secrets.HOSTNAME }} + TELEPORT_TOKEN: ${{ secrets.TELEPORT_TOKEN }} + distribute_matrix_deb: if: (github.ref_type == 'branch' && github.base_ref == '') permissions: write-all @@ -78,7 +134,7 @@ jobs: platform: - amd64 - armhf - uses: signalwire/actions-template/.github/workflows/cd-scp.yml@main + uses: s3rj1k/actions-template/.github/workflows/cd-scp.yml@CMake_RPM with: ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.codename }}-${{ matrix.platform }}-artifact TARGET_FOLDER: /var/www/libks-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.platform }}/${{ github.run_id }}-${{ github.run_number }} @@ -92,6 +148,33 @@ jobs: HOSTNAME: ${{ secrets.HOSTNAME }} TELEPORT_TOKEN: ${{ secrets.TELEPORT_TOKEN }} + distribute_meta_rpm: + if: (github.ref_type == 'branch' && github.base_ref == '') + permissions: write-all + name: 'Copy meta to remote RPM' + needs: [ generate_meta_rpm ] + strategy: + max-parallel: 1 + matrix: + os: + - rpm + platform: + - amd64 + uses: s3rj1k/actions-template/.github/workflows/cd-libs-metadata.yml@CMake_RPM + with: + ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.platform }}-meta + LIB_NAME: sofia-sip + SOURCE_BRANCH: ${{ github.ref_name }} + TARGET_OS: ${{ matrix.os }} + TARGET_PLATFORM: ${{ matrix.platform }} + RUNNER: ubuntu-latest + TARGET_REPO: signalwire/bamboo_gha_trigger + secrets: + GH_BOT_DEPLOY_TOKEN: ${{ secrets.PAT }} + concurrency: + group: libks-${{ matrix.os }}-${{ matrix.platform }} + cancel-in-progress: false + distribute_meta_deb: if: (github.ref_type == 'branch' && github.base_ref == '') permissions: write-all @@ -110,7 +193,7 @@ jobs: platform: - amd64 - armhf - uses: signalwire/actions-template/.github/workflows/cd-libs-metadata.yml@main + uses: s3rj1k/actions-template/.github/workflows/cd-libs-metadata.yml@CMake_RPM with: ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.codename }}-${{ matrix.platform }}-meta LIB_NAME: libks @@ -125,12 +208,34 @@ jobs: group: libks-${{ matrix.os }}-${{ matrix.platform }} cancel-in-progress: true + distribute_hash_rpm: + if: (github.ref_type == 'branch' && github.base_ref == '') + permissions: write-all + name: 'Copy hash to remote RPM' + needs: [ distribute_meta_rpm ] + uses: s3rj1k/actions-template/.github/workflows/cd-scp.yml@CMake_RPM + strategy: + matrix: + os: + - rpm + platform: + - amd64 + with: + RUNNER: ubuntu-latest + CREATE_DESTINATION_FOLDERS: false + EXEC_COMMANDS: 'echo "${{ github.sha }}" > /var/www/libks-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.platform }}/${{ github.run_id }}-${{ github.run_number }}/hash.txt' + secrets: + PROXY_URL: ${{ secrets.PROXY_URL }} + USERNAME: ${{ secrets.USERNAME }} + HOSTNAME: ${{ secrets.HOSTNAME }} + TELEPORT_TOKEN: ${{ secrets.TELEPORT_TOKEN }} + distribute_hash_deb: if: (github.ref_type == 'branch' && github.base_ref == '') permissions: write-all name: 'Copy hash to remote DEB' needs: [ distribute_meta_deb ] - uses: signalwire/actions-template/.github/workflows/cd-scp.yml@main + uses: s3rj1k/actions-template/.github/workflows/cd-scp.yml@CMake_RPM strategy: matrix: os: