Skip to content

Commit

Permalink
Merge pull request freeswitch#247 from freeswitch/gha_set_source_branch
Browse files Browse the repository at this point in the history
GHA: Use source branch name in metarepo.
  • Loading branch information
s3rj1k authored Jan 25, 2024
2 parents 97a4aa8 + 6b04ca8 commit aa96cbc
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build and Distribute

on:
pull_request:
push:
branches: [ master ]
paths:
Expand Down Expand Up @@ -44,6 +45,7 @@ jobs:
PLATFORM: ${{ matrix.platform }}

generate_meta_rpm:
if: (github.ref_type == 'branch' && github.base_ref == '')
name: 'Meta RPM'
needs: [ build_rpm ]
strategy:
Expand All @@ -57,9 +59,10 @@ jobs:
ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.platform }}-artifact
OS_PLATFORM: ${{ matrix.os }}-${{ matrix.platform }}
RUNNER: ubuntu-latest
FILE_PATH_PREFIX: /var/www/sofia-${{ matrix.os }}-${{ matrix.platform }}/${{ github.run_id }}-${{ github.run_number }}
FILE_PATH_PREFIX: /var/www/sofia-${{ 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'
needs: [ build_deb ]
strategy:
Expand All @@ -79,9 +82,10 @@ jobs:
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/sofia-${{ matrix.os }}-${{ matrix.platform }}/${{ github.run_id }}-${{ github.run_number }}
FILE_PATH_PREFIX: /var/www/sofia-${{ 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 ]
Expand All @@ -94,7 +98,7 @@ jobs:
uses: signalwire/actions-template/.github/workflows/cd-scp.yml@main
with:
ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.platform }}-artifact
TARGET_FOLDER: /var/www/sofia-${{ matrix.os }}-${{ matrix.platform }}/${{ github.run_id }}-${{ github.run_number }}
TARGET_FOLDER: /var/www/sofia-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.platform }}/${{ github.run_id }}-${{ github.run_number }}
RUNNER: ubuntu-latest
FILES: '*.tar.gz'
CREATE_DESTINATION_FOLDERS: true
Expand All @@ -106,6 +110,7 @@ jobs:
TELEPORT_TOKEN: ${{ secrets.TELEPORT_TOKEN }}

distribute_matrix_deb:
if: (github.ref_type == 'branch' && github.base_ref == '')
permissions: write-all
name: 'Copy to remote DEB'
needs: [ build_deb ]
Expand All @@ -124,7 +129,7 @@ jobs:
uses: signalwire/actions-template/.github/workflows/cd-scp.yml@main
with:
ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.codename }}-${{ matrix.platform }}-artifact
TARGET_FOLDER: /var/www/sofia-${{ matrix.os }}-${{ matrix.platform }}/${{ github.run_id }}-${{ github.run_number }}
TARGET_FOLDER: /var/www/sofia-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.platform }}/${{ github.run_id }}-${{ github.run_number }}
RUNNER: ubuntu-latest
FILES: '*.tar.gz'
CREATE_DESTINATION_FOLDERS: true
Expand All @@ -136,6 +141,7 @@ jobs:
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 ]
Expand All @@ -150,6 +156,7 @@ jobs:
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
Expand All @@ -161,6 +168,7 @@ jobs:
cancel-in-progress: false

distribute_meta_deb:
if: (github.ref_type == 'branch' && github.base_ref == '')
permissions: write-all
name: 'Copy meta to remote DEB'
needs: [ generate_meta_deb ]
Expand All @@ -181,6 +189,7 @@ jobs:
with:
ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.codename }}-${{ matrix.platform }}-meta
LIB_NAME: sofia-sip
SOURCE_BRANCH: ${{ github.ref_name }}
TARGET_OS: ${{ matrix.os }}
TARGET_PLATFORM: ${{ matrix.platform }}
RUNNER: ubuntu-latest
Expand All @@ -192,6 +201,7 @@ jobs:
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 ]
Expand All @@ -205,14 +215,15 @@ jobs:
with:
RUNNER: ubuntu-latest
CREATE_DESTINATION_FOLDERS: false
EXEC_COMMANDS: 'echo "${{ github.sha }}" > /var/www/sofia-${{ matrix.os }}-${{ matrix.platform }}/${{ github.run_id }}-${{ github.run_number }}/hash.txt'
EXEC_COMMANDS: 'echo "${{ github.sha }}" > /var/www/sofia-${{ 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 ]
Expand All @@ -227,7 +238,7 @@ jobs:
with:
RUNNER: ubuntu-latest
CREATE_DESTINATION_FOLDERS: false
EXEC_COMMANDS: 'echo "${{ github.sha }}" > /var/www/sofia-${{ matrix.os }}-${{ matrix.platform }}/${{ github.run_id }}-${{ github.run_number }}/hash.txt'
EXEC_COMMANDS: 'echo "${{ github.sha }}" > /var/www/sofia-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.platform }}/${{ github.run_id }}-${{ github.run_number }}/hash.txt'
secrets:
PROXY_URL: ${{ secrets.PROXY_URL }}
USERNAME: ${{ secrets.USERNAME }}
Expand Down

0 comments on commit aa96cbc

Please sign in to comment.