Skip to content

T6732: build image workflow updated version to branch mapping #1

T6732: build image workflow updated version to branch mapping

T6732: build image workflow updated version to branch mapping #1

Workflow file for this run

name: Build Image (VYOS)
on:
workflow_call:
inputs:
debian_mirror_url:
required: false
type: string
default: 'http://deb.debian.org/debian/'
debian_security_mirror_url:
required: false
type: string
default: ''
vyos_mirror_base_url:
required: false
type: string
default: 'https://packages.vyos.net/repositories'
arch:
required: false
type: string
default: amd64
build_by:
required: false
type: string
default: '[email protected]'
release_version:
required: true
type: string
default: ''
release_flavor:
required: false
type: string
default: 'generic'
upload_bucket_url:
required: false
type: string
default: ''
secrets:
token:
required: false
env:
BUILD_BY: ${{ inputs.build_by }}
DEBIAN_MIRROR: ${{ inputs.debian_mirror_url }}
VYOS_MIRROR_APT_KEY: https://packages.vyos.net/vyos_dev_public.key
LOCAL_GPG_KEY_PATH: /etc/apt/trusted.gpg.d/vyos_dev.gpg
RELEASE_FLAVOR: ${{ inputs.release_flavor }}
RELEASE_VERSION: ${{ inputs.release_version }}
jobs:
prepare-inputs:
runs-on: ubuntu-latest
outputs:
build_branch: ${{ steps.set_branch.outputs.build_branch }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set vyos-build branch based on version
id: set_branch
run: |

Check failure on line 61 in .github/workflows/build-image.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build-image.yml

Invalid workflow file

You have an error in your yaml syntax on line 61
branch='main'
version="${{ inputs.release_version }}"
if [[ "$version" =~ ^1\.3\..* ]]; then
branch='equuleus'
elif [[ "$version" =~ ^1\.4\..* ]]; then
branch='sagitta'
elif [[ "$version" =~ ^1\.5\..* ]]; then
branch='circinus'
else
echo "ERROR - Unsupported version number $version" >&2
exit 1
fi
echo "build_branch=$branch" >> $GITHUB_OUTPUT
build-iso:
needs: prepare-inputs
runs-on: ubuntu-latest
container:
image: vyos/vyos-build:${{ needs.prepare-inputs.outputs.build_branch }}
options: --workdir /vyos --privileged
env:
BUILD_BRANCH: ${{ needs.prepare-inputs.outputs.build_branch }}
VYOS_MIRROR: ${{ inputs.vyos_mirror_base_url }}/${{ needs.prepare-inputs.outputs.build_branch }}/
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
repository: vyos/vyos-build # Use public repo
ref: ${{ env.BUILD_BRANCH }}
- name: Mark directory as safe
run: |
set -eux
git config --global --add safe.directory '*'
- name: Setup env variables
run: |
set -eux
echo "BUILD_VERSION=${{ env.RELEASE_VERSION }}-${{ env.BUILD_BRANCH }}-$(date -u +%Y%m%d%H%M)" >> $GITHUB_ENV
- name: Get apt key
run: |
set -eux
wget ${{ env.VYOS_MIRROR_APT_KEY }}
mv vyos_dev_public.key ${{ env.LOCAL_GPG_KEY_PATH }}
- name: Build ISO
run: |
set -eux
git remote -v
./build-vyos-image \
--build-by ${{ env.BUILD_BY }} \
--build-type release \
--version $BUILD_VERSION \
--vyos-mirror ${{ env.VYOS_MIRROR }} \
--custom-apt-key ${{ env.LOCAL_GPG_KEY_PATH }} \
${{ env.RELEASE_FLAVOR }}
ls -la build/
- name: "Building: copy a ${{ env.RELEASE_FLAVOR }} ISO image"
if: ${{ !inputs.FAKE_BUILDING_PROCESS }}
id: copy_iso
run: |
set -eux
cp ./build/live-image-${{ inputs.arch }}.hybrid.iso ./vyos-$BUILD_VERSION-${{ inputs.arch }}.iso
- name: "Uploading artifacts: ISO image to GitHub"
id: upload_iso_artifact
uses: actions/upload-artifact@v4
with:
name: vyos-${{ env.BUILD_VERSION }}-${{ inputs.arch }}.iso
path: ./vyos-${{ env.BUILD_VERSION }}-${{ inputs.arch }}.iso
retention-days: 10
if-no-files-found: error