Skip to content

Commit

Permalink
lxd-trigger.yml: Add arm64 job
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias K <[email protected]>
  • Loading branch information
theCalcaholic committed Jan 25, 2024
1 parent 5c6cbad commit e3c3a42
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 28 deletions.
33 changes: 6 additions & 27 deletions .github/workflows/build-lxd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
arch:
required: false
type: string
default: 'x86'
default: 'x64'
outputs:
lxd_artifact_name:
value: "${{ jobs.build-current.outputs.artifact_name }}"
Expand All @@ -28,29 +28,9 @@ on:
- release/*

jobs:
determine-runner:
env:
LXD_ARCH: "${{ inputs.arch || 'x86' }}"
runs-on: ubuntu-20.04
outputs:
runner_label: ${{ steps.script.outputs.runner_label }}
steps:
- name: script
id: script
run: |
if [[ "${LXD_ARCH}" == "arm64" ]]
then
RUNNER_LABEL='["ubuntu-22.04", "ARM64", "ncp"]'
else
RUNNER_LABEL='["ubuntu-22.04", "X64"]'
fi
echo "runner_label=$RUNNER_LABEL" | tee -a $GITHUB_OUTPUT

build-current:
needs:
- determine-runner
runs-on:
- ${{ fromJSON(needs.determine-runner.outputs.runner_label) }}
runs-on: ${{ 'arm64' == inputs.arch && fromJSON('["ubuntu-22.04", "arm64"]') || fromJSON('["ubuntu-latest", "x64"]') }}
outputs:
artifact_name: "${{ env.ARTIFACT_NAME }}"
artifact_file: "${{ steps.pack-lxd.outputs.artifact_file }}"
Expand Down Expand Up @@ -86,7 +66,7 @@ jobs:
if-no-files-found: error

build-previous:
runs-on: ubuntu-20.04
runs-on: ${{ 'arm64' == inputs.arch && fromJSON('["ubuntu-22.04", "arm64"]') || fromJSON('["ubuntu-latest", "x64"]') }}
if: ${{ inputs.arch == 'x86' || inputs.arch == '' }}
outputs:
artifact_name: "${{ env.ARTIFACT_NAME }}"
Expand Down Expand Up @@ -175,7 +155,7 @@ jobs:
test-update:
needs:
- build-previous
runs-on: ubuntu-20.04
runs-on: ${{ 'arm64' == inputs.arch && fromJSON('["ubuntu-22.04", "arm64"]') || fromJSON('["ubuntu-latest", "x64"]') }}
outputs:
artifact_name: "${{ env.ARTIFACT_NAME }}"
artifact_file: "${{ steps.pack-lxd.outputs.artifact_file }}"
Expand Down Expand Up @@ -294,9 +274,8 @@ jobs:
test-fresh-install:
needs:
- determine-runner
- build-current
runs-on: ${{ fromJSON(needs.determine-runner.outputs.runner_label) }}
runs-on: ${{ 'arm64' == inputs.arch && fromJSON('["ubuntu-22.04", "arm64"]') || fromJSON('["ubuntu-latest", "x64"]') }}
env:
VERSION: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
ARTIFACT_NAME: ${{ needs.build-current.outputs.artifact_name }}
Expand Down Expand Up @@ -387,7 +366,7 @@ jobs:
convert-to-lxc-image:
needs:
- build-current
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
outputs:
artifact_name: "${{ steps.lxd-to-lxc.outputs.artifact_name }}"
artifact_file: "${{ steps.lxd-to-lxc.outputs.artifact_file }}"
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/lxd-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ jobs:
uses: ./.github/workflows/build-lxd.yml
with:
git_ref: "${{ github.ref }}"
arch: 'x64'
lxd-arm64:
uses: ./.github/workflows/build-lxd.yml
with:
git_ref: "${{ github.ref }}"
arch: 'arm64'
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
uses: ./.github/workflows/build-lxd.yml
with:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
arch: 'x86'
arch: 'x64'
secrets: inherit
lxd-arm64:
if: ${{ inputs.lxd || ( github.event_name != 'workflow_dispatch' && !startsWith(github.ref_name, 'docker-') ) }}
Expand Down

0 comments on commit e3c3a42

Please sign in to comment.