Skip to content

Build CmusicAI

Build CmusicAI #77

name: Build CmusicAI
on:
workflow_dispatch:
inputs:
target:
description: 'Target branch to run'
required: true
version:
description: 'Version that will be built'
required: true
env:
SCRIPTS: ${{ github.workspace }}/.github/scripts
jobs:
check-jobs:
runs-on: ubuntu-20.04
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: 'never'
skip_after_successful_duplicate: 'true'
paths_ignore: '[
"binaries/**",
"community/**",
"contrib/**",
"doc/**",
"roadmap/**",
"share/**",
"static-builds/**",
"whitepaper/**",
"**/*.md"
]'
do_not_skip: '["workflow_dispatch", "schedule"]'
build:
needs: check-jobs
runs-on: ubuntu-20.04
strategy:
matrix:
OS: [ 'osx' ]
steps:
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
name: Checkout the Code
uses: actions/checkout@v1
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
name: Install Build Tools
run: sudo ${SCRIPTS}/00-install-deps.sh ${{ matrix.OS }}
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
name: Cache dependencies.
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/depends/built
${{ github.workspace }}/depends/sources
${{ github.workspace }}/depends/work
key: ${{ matrix.OS }}
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
name: Build dependencies.
run: ${SCRIPTS}/02-copy-build-dependencies.sh ${{ matrix.OS }} ${{ github.workspace }} ${{ github.base_ref }} ${{ github.ref }}
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
name: Add Dependencies to the System PATH
run: ${SCRIPTS}/03-export-path.sh ${{ matrix.OS }} ${{ github.workspace }}
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
name: Build Config
run: cd ${{ github.workspace }} && ./autogen.sh
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
name: Configure Build
run: ${SCRIPTS}/04-configure-build.sh ${{ matrix.OS }} ${{ github.workspace }}
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
name: Build CmusicAI
run: make -j2
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
name: Package Up the Build
run: ${SCRIPTS}/06-package.sh ${{ matrix.OS }} ${{ github.workspace }} ${{ github.event.inputs.version }}
- if: ${{ needs.check-jobs.outputs.should_skip != 'true' }}
name: Upload Artifacts to Job
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.OS }}-${{ github.event.inputs.version }}
path: ${{ github.workspace }}/release