Skip to content

Commit

Permalink
refactor CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
intelligide committed Nov 17, 2023
1 parent 5193a05 commit 17c1241
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 38 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
on:
workflow_call:
inputs:
P4D_VERSION:
required: true
type: string
DSM_VERSION:
required: true
type: string
SPK_PLATFORM:
required: true
type: string
SPK_ARCH:
required: true
type: string

jobs:
build:
name: Build Package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- id: setup_toolchain
name: Setup Toolchain
run: |
sudo -E ./.ci/setup-toolchain.sh
env:
DSM_VERSION: ${{ inputs.DSM_VERSION }}
SPK_PLATFORM: ${{ inputs.SPK_PLATFORM }}

- id: build_package
name: Build Package
run: |
sudo -E ./.ci/build-package.sh
env:
DSM_VERSION: ${{ inputs.DSM_VERSION }}
SPK_PLATFORM: ${{ inputs.SPK_PLATFORM }}
SPK_ARCH: ${{ inputs.SPK_ARCH }}
P4D_VERSION: ${{ inputs.P4D_VERSION }}
SPK_BETA: ${{ github.event_name != 'release' || (github.event_name == 'release' && github.event.release.prerelease) }}
SPK_PACKAGE_BUILD_NUMBER: "${{ github.run_number }}"

- name: Rename artifact
run: |
cp \
/toolkit/result_spk/HelixCoreServer-${{ steps.build_package.outputs.package_version }}/HelixCoreServer-${{ inputs.SPK_ARCH }}-${{ steps.build_package.outputs.package_version }}.spk \
${{ runner.temp }}/HelixCoreServer-${{ steps.build_package.outputs.package_version }}-${{ inputs.SPK_ARCH }}-${{ inputs.DSM_VERSION }}.spk
- id: upload_package
name: Upload Package
uses: actions/upload-artifact@v3
with:
name: HelixCoreServer-${{ steps.build_package.outputs.package_version }}-${{ inputs.SPK_ARCH }}-${{ inputs.DSM_VERSION }}
path: ${{ runner.temp }}/HelixCoreServer-${{ steps.build_package.outputs.package_version }}-${{ inputs.SPK_ARCH }}-${{ inputs.DSM_VERSION }}.spk
if-no-files-found: error
45 changes: 7 additions & 38 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ on:

jobs:
build:
name: Build Packages
runs-on: ubuntu-latest
name: Build Package
strategy:
fail-fast: false
matrix:
Expand All @@ -20,42 +19,12 @@ jobs:
include:
- SPK_PLATFORM: braswell
SPK_ARCH: x86_64
steps:
- uses: actions/checkout@v3

- id: setup_toolchain
name: Setup Toolchain
run: |
sudo -E ./.ci/setup-toolchain.sh
env:
DSM_VERSION: ${{ matrix.DSM_VERSION }}
SPK_PLATFORM: ${{ matrix.SPK_PLATFORM }}

- id: build_package
name: Build Package
run: |
sudo -E ./.ci/build-package.sh
env:
DSM_VERSION: ${{ matrix.DSM_VERSION }}
SPK_PLATFORM: ${{ matrix.SPK_PLATFORM }}
SPK_ARCH: ${{ matrix.SPK_ARCH }}
P4D_VERSION: ${{ matrix.P4D_VERSION }}
SPK_BETA: ${{ github.event_name != 'release' || (github.event_name == 'release' && github.event.release.prerelease) }}
SPK_PACKAGE_BUILD_NUMBER: "${{ github.run_number }}"

- name: Rename artifact
run: |
cp \
/toolkit/result_spk/HelixCoreServer-${{ steps.build_package.outputs.package_version }}/HelixCoreServer-${{ matrix.SPK_ARCH }}-${{ steps.build_package.outputs.package_version }}.spk \
${{ runner.temp }}/HelixCoreServer-${{ steps.build_package.outputs.package_version }}-${{ matrix.SPK_ARCH }}-${{ matrix.DSM_VERSION }}.spk
- id: upload_package
name: Upload Package
uses: actions/upload-artifact@v3
with:
name: HelixCoreServer-${{ steps.build_package.outputs.package_version }}-${{ matrix.SPK_ARCH }}-${{ matrix.DSM_VERSION }}
path: ${{ runner.temp }}/HelixCoreServer-${{ steps.build_package.outputs.package_version }}-${{ matrix.SPK_ARCH }}-${{ matrix.DSM_VERSION }}.spk
if-no-files-found: error
uses: ./.github/workflows/build-package.yml
with:
P4D_VERSION: ${{ matrix.P4D_VERSION }}
DSM_VERSION: ${{ matrix.DSM_VERSION }}
SPK_PLATFORM: ${{ matrix.SPK_PLATFORM }}
SPK_ARCH: ${{ matrix.SPK_ARCH }}

release:
name: Upload Packages in Github Release
Expand Down

0 comments on commit 17c1241

Please sign in to comment.