Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHA: Use source branch name in metarepo. #247

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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