Release #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Release | |
env: | |
VSPHERE_USERNAME: ${{ secrets.VSPHERE_NKP_SRE_USERNAME }} | |
VSPHERE_PASSWORD: ${{ secrets.VSPHERE_SRE_PASSWORD }} | |
VSPHERE_SERVER: ${{ secrets.VSPHERE_NKP_SERVER }} | |
GOVC_URL: ${{ secrets.VSPHERE_NKP_SRE_USERNAME }}:${{ secrets.VSPHERE_SRE_PASSWORD }}@${{ secrets.VSPHERE_NKP_SERVER }} | |
PKR_VAR_vsphere_cluster: ${{ secrets.VSPHERE_CLUSTER }} | |
PKR_VAR_vsphere_datacenter: ${{ secrets.VSPHERE_DATACENTER }} | |
PKR_VAR_vsphere_datastore: ${{ secrets.VSPHERE_NKP_DATASTORE }} | |
PKR_VAR_vsphere_network: ${{ secrets.VSPHERE_NKP_NETWORK }} | |
PKR_VAR_vsphere_resource_pool: ${{ secrets.VSPHERE_RESOURCE_POOL }} | |
RHN_SUBSCRIPTION_ORG: ${{ secrets.RHN_SUBSCRIPTION_ORG }} | |
RHN_SUBSCRIPTION_KEY: ${{ secrets.RHN_SUBSCRIPTION_KEY }} | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
inputs: | |
os: | |
description: "The OS to run the release with" | |
type: choice | |
required: true | |
options: | |
- all | |
- ubuntu-20 | |
- ubuntu-22 | |
- os-ubuntu | |
- rocky-8.7 | |
- rocky-9.1 | |
- os-rocky | |
- centos-7.9 | |
- os-centos | |
- rhel-8.6 | |
- rhel-8.8 | |
- rhel-8.10 | |
- rhel-9.4 | |
- os-rhel | |
- oraclelinux-9.4 | |
- os-oraclelinux | |
- flatcar-3033.3.16 | |
- os-flatcar | |
jobs: | |
build_list: | |
runs-on: self-hosted-nutanix-medium | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }}} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- name: Empty OS matrix | |
id: empty-os-matrix | |
run: | | |
echo "buildmatrix=$(jq -cn --arg os_list '' '{os: $os_list | split(",")}')" >> $GITHUB_ENV | |
- name: Build OS matrix for all OS | |
if: github.event.inputs.os == 'all' || startsWith(github.ref, 'refs/tags/') | |
id: build-os-matrix | |
run: | | |
DYNAMICOSLIST=$(make list-os-versions | head -c -1 | tr '\n' ',') | |
echo "buildmatrix=$(jq -cn --arg os_list $DYNAMICOSLIST '{os: $os_list | split(",")}')" >> $GITHUB_ENV | |
- name: Build OS matrix for distro (os prefix) | |
if: contains(github.event.inputs.os, 'os-') | |
id: build-os-matrix-distro | |
run: | | |
OSPREFIX=$(echo ${{ github.event.inputs.os }} | cut -d '-' -f 2) | |
DYNAMICOSLIST=$(make list-os-versions | grep -E "$OSPREFIX" | head -c -1 | tr '\n' ',') | |
echo "buildmatrix=$(jq -cn --arg os_list $DYNAMICOSLIST '{os: $os_list | split(",")}')" >> $GITHUB_ENV | |
- name: Build OS matrix for single OS | |
if: github.event.inputs.os != 'all' && !contains(github.event.inputs.os, 'os-') | |
id: build-os-matrix-single | |
run: | | |
echo "buildmatrix=$(jq -cn --arg os_list '${{ github.event.inputs.os }}' '{os: $os_list | split(",")}')" >> $GITHUB_ENV | |
- name: Set matrix output | |
id: set-matrix | |
run: | | |
echo 'matrix=${{ env.buildmatrix }}' >> $GITHUB_OUTPUT | |
release: | |
name: Create D2iQ Templates | |
runs-on: self-hosted-nutanix-medium | |
needs: build_list | |
strategy: | |
fail-fast: false | |
matrix: ${{fromJson(needs.build_list.outputs.matrix)}} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.ref }} | |
- name: Setup requirements | |
run: | | |
sudo apt-get update && sudo apt-get -y install xorriso | |
curl -L -o - "https://github.com/vmware/govmomi/releases/latest/download/govc_$(uname -s)_$(uname -m).tar.gz" | sudo tar -C /usr/local/bin -xvzf - govc | |
- name: Run release for ${{ matrix.os }} | |
run: make ${{ matrix.os }}-release | |
create_release: | |
permissions: | |
contents: write | |
name: Create Github release | |
runs-on: self-hosted-nutanix-medium | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
export: | |
name: Generate OVF for Export | |
needs: [release] | |
runs-on: self-hosted-nutanix-medium | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-20 | |
- ubuntu-22 | |
- rocky-8.7 | |
- rocky-9.1 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.ref }} | |
- name: Setup requirements | |
run: | | |
sudo apt-get update && sudo apt-get -y install xorriso | |
- name: Export ovf for ${{ matrix.os }} | |
run: make ${{ matrix.os }}-ovf | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: releaseovf | |
path: | | |
manifests/ovf/*.ovf.tar.gz | |
artifactinventory: | |
name: Create artifact inventory | |
runs-on: self-hosted-nutanix-medium | |
needs: [export] | |
outputs: | |
listovf: ${{ steps.list.outputs.listovf }} | |
steps: | |
- uses: actions/download-artifact@v3 | |
id: download | |
with: | |
name: releaseovf | |
path: releaseovf/ | |
- name: json from downloaded artifacts | |
id: list | |
run: | | |
DATA=$(ls releaseovf/*.ovf.tar.gz | jq -R -s -c 'split("\n")[:-1]') | |
echo "listovf=$DATA" >> "$GITHUB_OUTPUT" | |
releaseassets: | |
name: Upload release assets | |
permissions: | |
contents: write | |
runs-on: self-hosted-nutanix-medium | |
needs: [create_release, artifactinventory] | |
strategy: | |
fail-fast: false | |
matrix: | |
ovf: ${{ fromJSON(needs.artifactinventory.outputs.listovf) }} | |
steps: | |
- uses: actions/download-artifact@v3 | |
id: download | |
with: | |
name: releaseovf | |
path: releaseovf/ | |
- name: Upload ovf | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_path: ./${{ matrix.ovf }} | |
asset_name: ${{ matrix.ovf }} | |
asset_content_type: application/zip |