Skip to content

Merge pull request #33 from xiaoyue26/main #55

Merge pull request #33 from xiaoyue26/main

Merge pull request #33 from xiaoyue26/main #55

Workflow file for this run

name: Build and Distribute
on:
pull_request:
push:
branches:
- main
paths:
- "**"
workflow_dispatch:
inputs:
publish:
description: 'Publish build data'
required: true
default: false
type: boolean
concurrency:
group: ${{ github.head_ref || github.ref }}
jobs:
get-nonce:
name: 'Get Nonce for token'
if: |
(
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository &&
!contains(github.event.pull_request.changed_files, '.github/')
) ||
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository ||
github.actor == github.repository_owner
runs-on: freeswitch-org-auth-client
outputs:
nonce: ${{ steps.get-nonce.outputs.nonce }}
steps:
- name: Get Nonce
id: get-nonce
uses: signalwire/actions-template/.github/actions/repo-auth-client@main
with:
mode: nonce
issue-token:
name: 'Issue temporary token'
runs-on: ubuntu-latest
needs: get-nonce
outputs:
token: ${{ steps.issue-token.outputs.token }}
steps:
- name: Issue Token
id: issue-token
uses: signalwire/actions-template/.github/actions/repo-auth-client@main
env:
NONCE: ${{ needs.get-nonce.outputs.nonce }}
with:
mode: issue
deb-fse:
name: 'DEB-FSE'
if: >-
${{
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository ||
github.actor == github.repository_owner
}}
permissions:
id-token: write
contents: read
uses: signalwire/actions-template/.github/workflows/cicd-docker-build-and-distribute.yml@main
strategy:
# max-parallel: 1
fail-fast: false
matrix:
os:
- debian
version:
- bookworm
- bullseye
platform:
- name: amd64
runner: ubuntu-latest
- name: arm32v7
runner: ubuntu-24.04-arm
- name: arm64v8
runner: ubuntu-24.04-arm
release:
- release
with:
RUNNER: ${{ matrix.platform.runner }}
ARTIFACTS_PATTERN: '.*\.(deb)$'
DOCKERFILE: .github/docker/${{ matrix.os }}/${{ matrix.version }}/${{ matrix.platform.name }}/fse.${{ matrix.release }}.Dockerfile
MAINTAINER: 'Andrey Volk <[email protected]>'
META_FILE_PATH_PREFIX: /var/www/mod_unimrcp/fse/${{ matrix.release }}/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}
PLATFORM: ${{ matrix.platform.name }}
REPO_DOMAIN: 'fsa.freeswitch.com'
TARGET_ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-fse-${{ matrix.release }}-artifact
UPLOAD_BUILD_ARTIFACTS: >-
${{
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch' && inputs.publish)
}}
secrets:
GH_BOT_DEPLOY_TOKEN: ${{ secrets.PAT }}
HOSTNAME: ${{ secrets.HOSTNAME }}
PROXY_URL: ${{ secrets.PROXY_URL }}
USERNAME: ${{ secrets.USERNAME }}
TELEPORT_TOKEN: ${{ secrets.TELEPORT_TOKEN }}
REPO_USERNAME: ${{ secrets.FSE_USERNAME }}
REPO_PASSWORD: ${{ secrets.FSE_PASSWORD }}
deb-public:
name: 'DEB-PUBLIC'
permissions:
id-token: write
contents: read
needs:
- issue-token
uses: signalwire/actions-template/.github/workflows/cicd-docker-build-and-distribute.yml@main
strategy:
# max-parallel: 1
fail-fast: false
matrix:
os:
- debian
version:
- bookworm
- bullseye
platform:
- name: amd64
runner: ubuntu-latest
- name: arm32v7
runner: ubuntu-24.04-arm
- name: arm64v8
runner: ubuntu-24.04-arm
release:
- release
with:
RUNNER: ${{ matrix.platform.runner }}
ARTIFACTS_PATTERN: '.*\.(deb)$'
DOCKERFILE: .github/docker/${{ matrix.os }}/${{ matrix.version }}/${{ matrix.platform.name }}/public.${{ matrix.release }}.Dockerfile
MAINTAINER: 'Andrey Volk <[email protected]>'
META_FILE_PATH_PREFIX: /var/www/mod_unimrcp/public/${{ matrix.release }}/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}
PLATFORM: ${{ matrix.platform.name }}
REPO_DOMAIN: 'freeswitch.signalwire.com'
TARGET_ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-${{ matrix.release }}-artifact
UPLOAD_BUILD_ARTIFACTS: >-
${{
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch' && inputs.publish)
}}
secrets:
GH_BOT_DEPLOY_TOKEN: ${{ secrets.PAT }}
HOSTNAME: ${{ secrets.HOSTNAME }}
PROXY_URL: ${{ secrets.PROXY_URL }}
USERNAME: ${{ secrets.USERNAME }}
TELEPORT_TOKEN: ${{ secrets.TELEPORT_TOKEN }}
REPO_USERNAME: 'signalwire'
REPO_PASSWORD: ${{ needs.issue-token.outputs.token }}
revoke-token:
name: 'Revoke temporary token'
runs-on: ubuntu-latest
# if: always()
needs:
- issue-token
- deb-public
steps:
- name: Revoke Token
id: revoke-token
uses: signalwire/actions-template/.github/actions/repo-auth-client@main
env:
TOKEN: ${{ needs.issue-token.outputs.token }}
with:
mode: revoke
meta:
name: 'Publish build data to meta-repo'
if: >-
${{
github.event_name == 'push' ||
(github.event_name == 'workflow_dispatch' && inputs.publish)
}}
needs:
- deb-fse
- deb-public
permissions:
id-token: write
contents: read
uses: signalwire/actions-template/.github/workflows/meta-repo-content.yml@main
with:
META_CONTENT: '/var/www/mod_unimrcp/{fse,public}/release/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}'
META_REPO: signalwire/bamboo_gha_trigger
META_REPO_BRANCH: trigger/mod_unimrcp/${{ github.ref_name }}
secrets:
GH_BOT_DEPLOY_TOKEN: ${{ secrets.PAT }}