Skip to content

Commit

Permalink
Add release-flavors repo
Browse files Browse the repository at this point in the history
  • Loading branch information
c-po committed Jan 13, 2025
1 parent c8793c2 commit 6cd2650
Showing 1 changed file with 90 additions and 31 deletions.
121 changes: 90 additions & 31 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ env:
VYOS_MIRROR: https://packages.vyos.net/repositories/current/

jobs:
build_iso:
build_generic_iso:
needs: repo_test
runs-on: ubuntu-24.04
permissions:
contents: write
Expand Down Expand Up @@ -84,7 +85,7 @@ jobs:
echo "PREVIOUS_SUCCESS_BUILD_TIMESTAMP=$(cat version.json | jq -r '.[0].timestamp')" >> $GITHUB_OUTPUT
echo "BUILD_BY=$BUILD_BY" >> $GITHUB_OUTPUT
- name: Clone vyos-build repo
- name: Checkout vyos-build repo
uses: actions/checkout@v4
with:
# Clone to sub-path required for minisign binary shipped in this repo
Expand Down Expand Up @@ -128,8 +129,66 @@ jobs:
retention-days: 30
if-no-files-found: error

build_vmware-vsphere:
needs: repo_test
runs-on: ubuntu-24.04
permissions:
contents: write
container:
image: vyos/vyos-build:current
options: --sysctl net.ipv6.conf.lo.disable_ipv6=0 --privileged

steps:
### Initialization ###
- uses: actions/checkout@v4
- name: "Initialization: set env variables"
id: set_env_variables
run: |
set -x
if [ -n "${{ github.event.inputs.BUILD_BY }}" ]; then
echo "BUILD_BY=${{ github.event.inputs.BUILD_BY }}" >> $GITHUB_ENV
fi
if [ -z "${{ github.event.inputs.build_version }}" ]; then
echo "build_version=1.5-rolling-$(date -u +%Y%m%d%H%M)" >> $GITHUB_OUTPUT
else
echo "build_version=${{ github.event.inputs.build_version }}" >> $GITHUB_OUTPUT
fi
echo "TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_OUTPUT
echo "PREVIOUS_SUCCESS_BUILD_TIMESTAMP=$(cat version.json | jq -r '.[0].timestamp')" >> $GITHUB_OUTPUT
echo "BUILD_BY=$BUILD_BY" >> $GITHUB_OUTPUT
- name: Checkout vyos-build repo
uses: actions/checkout@v4
with:
# Clone to sub-path required for minisign binary shipped in this repo
# This might change with future Debian versions when they ship minisign
repository: vyos/vyos-build
path: vyos-build

- name: Checkout build-flavors repository
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
repository: VyOS-Networks/release-flavors
path: release-flavors

- name: Build generic ISO image
id: build_generic_iso
run: |
cd vyos-build
sudo --preserve-env VYOS_BUILD_FLAVORS_DIR=$GITHUB_WORKSPACE/release-flavors/ ./build-vyos-image \
--architecture amd64 \
--build-by $BUILD_BY \
--build-type release \
--debian-mirror $DEBIAN_MIRROR \
--debian-security-mirror $DEBIAN_SECURITY_MIRROR \
--version ${{ steps.set_env_variables.outputs.build_version }} \
--vyos-mirror $VYOS_MIRROR \
vmware-vsphere
cat jq --raw-output .artifacts[0] build/manifest.json
test_smoketest_cli:
needs: build_iso
needs: build_generic_iso
runs-on: ubuntu-24.04
if: ${{ !inputs.SKIP_SMOKETEST_CLI }}
container:
Expand All @@ -143,7 +202,7 @@ jobs:
repository: vyos/vyos-build
- uses: actions/download-artifact@v4
with:
name: ${{ needs.build_iso.outputs.generic_image_name }}
name: ${{ needs.build_generic_iso.outputs.generic_image_name }}
path: build
- name: VyOS CLI smoketests (no interfaces)
id: test
Expand All @@ -152,7 +211,7 @@ jobs:
set -e
# extract ISO image from artifact
find build -type f -exec cp {} build \;
ln -s ${{ needs.build_iso.outputs.generic_image_iso }} build/live-image-amd64.hybrid.iso
ln -s ${{ needs.build_generic_iso.outputs.generic_image_iso }} build/live-image-amd64.hybrid.iso
sudo make test-no-interfaces | tee smoketest_make_test_no_interfaces.log
- uses: actions/upload-artifact@v4
with:
Expand All @@ -162,7 +221,7 @@ jobs:
if-no-files-found: error

test_interfaces_cli:
needs: build_iso
needs: build_generic_iso
runs-on: ubuntu-24.04
if: ${{ !inputs.SKIP_SMOKETEST_CLI }}
container:
Expand All @@ -176,7 +235,7 @@ jobs:
repository: vyos/vyos-build
- uses: actions/download-artifact@v4
with:
name: ${{ needs.build_iso.outputs.generic_image_name }}
name: ${{ needs.build_generic_iso.outputs.generic_image_name }}
path: build
- name: VyOS CLI smoketests (interfaces only)
id: test
Expand All @@ -185,7 +244,7 @@ jobs:
set -e
# extract ISO image from artifact
find build -type f -exec cp {} build \;
ln -s ${{ needs.build_iso.outputs.generic_image_iso }} build/live-image-amd64.hybrid.iso
ln -s ${{ needs.build_generic_iso.outputs.generic_image_iso }} build/live-image-amd64.hybrid.iso
sudo make test-interfaces | tee smoketest_make_test_interfaces.log
- uses: actions/upload-artifact@v4
with:
Expand All @@ -195,7 +254,7 @@ jobs:
if-no-files-found: error

test_config_load:
needs: build_iso
needs: build_generic_iso
runs-on: ubuntu-24.04
if: ${{ !inputs.SKIP_SMOKETEST_CONFIG }}
container:
Expand All @@ -209,7 +268,7 @@ jobs:
repository: vyos/vyos-build
- uses: actions/download-artifact@v4
with:
name: ${{ needs.build_iso.outputs.generic_image_name }}
name: ${{ needs.build_generic_iso.outputs.generic_image_name }}
path: build
- name: VyOS config load tests
id: test
Expand All @@ -218,7 +277,7 @@ jobs:
set -e
# extract ISO image from artifact
find build -type f -exec cp {} build \;
ln -s ${{ needs.build_iso.outputs.generic_image_iso }} build/live-image-amd64.hybrid.iso
ln -s ${{ needs.build_generic_iso.outputs.generic_image_iso }} build/live-image-amd64.hybrid.iso
sudo make testc | tee smoketest_make_testc.log
- uses: actions/upload-artifact@v4
with:
Expand All @@ -228,7 +287,7 @@ jobs:
if-no-files-found: error

test_raid1_install:
needs: build_iso
needs: build_generic_iso
runs-on: ubuntu-24.04
if: ${{ !inputs.SKIP_SMOKETEST_RAID1 }}
container:
Expand All @@ -242,7 +301,7 @@ jobs:
repository: vyos/vyos-build
- uses: actions/download-artifact@v4
with:
name: ${{ needs.build_iso.outputs.generic_image_name }}
name: ${{ needs.build_generic_iso.outputs.generic_image_name }}
path: build
- name: VyOS RAID1 installation tests
id: test
Expand All @@ -251,7 +310,7 @@ jobs:
set -e
# extract ISO image from artifact
find build -type f -exec cp {} build \;
ln -s ${{ needs.build_iso.outputs.generic_image_iso }} build/live-image-amd64.hybrid.iso
ln -s ${{ needs.build_generic_iso.outputs.generic_image_iso }} build/live-image-amd64.hybrid.iso
sudo make testraid | tee smoketest_make_testraid.log
- uses: actions/upload-artifact@v4
with:
Expand All @@ -261,7 +320,7 @@ jobs:
if-no-files-found: error

test_encrypted_config_tpm:
needs: build_iso
needs: build_generic_iso
runs-on: ubuntu-24.04
if: ${{ !inputs.SKIP_SMOKETEST_TPM }}
container:
Expand All @@ -275,7 +334,7 @@ jobs:
repository: vyos/vyos-build
- uses: actions/download-artifact@v4
with:
name: ${{ needs.build_iso.outputs.generic_image_name }}
name: ${{ needs.build_generic_iso.outputs.generic_image_name }}
path: build
- name: VyOS TPM encryption tests
id: test
Expand All @@ -284,7 +343,7 @@ jobs:
set -e
# extract ISO image from artifact
find build -type f -exec cp {} build \;
ln -s ${{ needs.build_iso.outputs.generic_image_iso }} build/live-image-amd64.hybrid.iso
ln -s ${{ needs.build_generic_iso.outputs.generic_image_iso }} build/live-image-amd64.hybrid.iso
sudo make testtpm | tee smoketest_make_testtpm.log
- uses: actions/upload-artifact@v4
with:
Expand All @@ -300,7 +359,7 @@ jobs:
- test_smoketest_cli
- test_interfaces_cli
- test_encrypted_config_tpm
- build_iso
- build_generic_iso
runs-on: ubuntu-24.04
if: ${{ failure() && (github.ref == 'refs/heads/current') && !inputs.SKIP_SLACK_NOTIFICATIONS }}
steps:
Expand Down Expand Up @@ -381,7 +440,7 @@ jobs:
- test_smoketest_cli
- test_interfaces_cli
- test_encrypted_config_tpm
- build_iso
- build_generic_iso
runs-on: ubuntu-24.04
permissions:
contents: write
Expand All @@ -402,9 +461,9 @@ jobs:
shell: bash
run: |
cd vyos-build
echo "CHANGELOG_COMMIT_VYOS_BUILD=$(git log --since "${{ needs.build_iso.outputs.PREVIOUS_SUCCESS_BUILD_TIMESTAMP }}" --format="%H" --reverse | head -n1)" >> $GITHUB_OUTPUT
echo "CHANGELOG_COMMIT_VYOS_BUILD=$(git log --since "${{ needs.build_generic_iso.outputs.PREVIOUS_SUCCESS_BUILD_TIMESTAMP }}" --format="%H" --reverse | head -n1)" >> $GITHUB_OUTPUT
cd ../vyos-1x
echo "CHANGELOG_COMMIT_VYOS_1X=$(git log --since "${{ needs.build_iso.outputs.PREVIOUS_SUCCESS_BUILD_TIMESTAMP }}" --format="%H" --reverse | head -n1)" >> $GITHUB_OUTPUT
echo "CHANGELOG_COMMIT_VYOS_1X=$(git log --since "${{ needs.build_generic_iso.outputs.PREVIOUS_SUCCESS_BUILD_TIMESTAMP }}" --format="%H" --reverse | head -n1)" >> $GITHUB_OUTPUT
- name: "Release publishing: generate changelog for vyos-1x"
id: generate_changelog_for_vyos-1x
Expand Down Expand Up @@ -455,9 +514,9 @@ jobs:
json: |
[
{
"url": "https://github.com/vyos/vyos-nightly-build/releases/download/${{ needs.build_iso.outputs.build_version }}/${{ needs.build_iso.outputs.generic_image_iso }}",
"version": "${{ needs.build_iso.outputs.build_version }}",
"timestamp": "${{ needs.build_iso.outputs.TIMESTAMP }}"
"url": "https://github.com/vyos/vyos-nightly-build/releases/download/${{ needs.build_generic_iso.outputs.build_version }}/${{ needs.build_generic_iso.outputs.generic_image_iso }}",
"version": "${{ needs.build_generic_iso.outputs.build_version }}",
"timestamp": "${{ needs.build_generic_iso.outputs.TIMESTAMP }}"
}
]
Expand All @@ -470,23 +529,23 @@ jobs:
- name: "Release publishing: create autocommit and tag"
uses: stefanzweifel/git-auto-commit-action@v5
with:
tagging_message: ${{ needs.build_iso.outputs.build_version }}
commit_message: ${{ needs.build_iso.outputs.build_version }}
commit_author: "vyosbot <${{ needs.build_iso.outputs.BUILD_BY }}>"
tagging_message: ${{ needs.build_generic_iso.outputs.build_version }}
commit_message: ${{ needs.build_generic_iso.outputs.build_version }}
commit_author: "vyosbot <${{ needs.build_generic_iso.outputs.BUILD_BY }}>"

- uses: actions/download-artifact@v4
with:
name: ${{ needs.build_iso.outputs.generic_image_name }}
name: ${{ needs.build_generic_iso.outputs.generic_image_name }}

- name: "Release publishing: publish release"
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.md
tag_name: ${{ needs.build_iso.outputs.build_version }}
tag_name: ${{ needs.build_generic_iso.outputs.build_version }}
fail_on_unmatched_files: true
files: |
vyos-build/build/${{ needs.build_iso.outputs.generic_image_iso }}
vyos-build/build/${{ needs.build_iso.outputs.generic_image_iso }}.minisig
vyos-build/build/${{ needs.build_generic_iso.outputs.generic_image_iso }}
vyos-build/build/${{ needs.build_generic_iso.outputs.generic_image_iso }}.minisig
- uses: Nats-ji/delete-old-releases@v1.0.1
with:
Expand Down

0 comments on commit 6cd2650

Please sign in to comment.