diff --git a/.github/workflows/pkr-bld-win-10.yml b/.github/workflows/pkr-bld-win-10.yml new file mode 100644 index 000000000..d843bd539 --- /dev/null +++ b/.github/workflows/pkr-bld-win-10.yml @@ -0,0 +1,64 @@ +--- +on: + workflow_call: + +env: + PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + +jobs: + x86_64: + runs-on: [self-hosted, X64, Windows, parallels] + strategy: + fail-fast: false + matrix: + os: + - windows-10 + provider: + - parallels-iso + - qemu + - virtualbox-iso + - vmware-iso + steps: + - name: Checkout + uses: actions/checkout@main + - name: iso-availability + shell: pwsh + run: Invoke-RestMethod -Method Head -Verbose -Uri $(Get-Content os_pkrvars/$('${{ matrix.os }}'.split('-')[0])/${{ matrix.os }}-x86_64.pkrvars.hcl | ConvertFrom-StringData).iso_url.Trim('"') + # - name: Setup Packer + # uses: hashicorp/setup-packer@main + # with: + # version: latest + - name: Packer Init + run: packer init -upgrade packer_templates + - name: Packer FMT + run: if packer fmt -check -recursive .; then exit 0; else echo "Some packer files need to be formatted, run 'packer fmt -recursive .' to fix"; exit 1; fi + - name: Packer Validate + run: packer validate -var-file=os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates + - name: Packer build + # run: packer build -timestamp-ui -only=${{ matrix.provider }}.vm -var-file=os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates + run: | + eval "$(chef shell-init bash)" + bento build -o parallels-iso.vm,qemu.vm,virtualbox-iso.vm,vmware-iso.vm --vars "qemu_accelerator=hvf" os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" + ls -alh builds + # - name: Bento Test + # run: | + # eval "$(chef shell-init bash)" + # bento test + - name: Remove VM in case of canceled job + if: cancelled() + run: | + VM="$(prlctl list -a | grep ${{ matrix.os }} | cut -d " " -f 1)" + echo Powering off and deleting any existing VMs named ${{ matrix.os }}*-amd64 + prlctl stop "$VM" --kill 2> /dev/null + sleep 1 + prlctl delete "$VM" 2> /dev/null + sleep 2 + - name: Upload build artifact + if: always() + uses: actions/upload-artifact@v3 + with: + name: "${{ matrix.os }}-x86_64" + path: | + builds + !builds/uploaded/* + retention-days: 10 diff --git a/.github/workflows/pkr-bld-win-11.yml b/.github/workflows/pkr-bld-win-11.yml new file mode 100644 index 000000000..b9e356002 --- /dev/null +++ b/.github/workflows/pkr-bld-win-11.yml @@ -0,0 +1,64 @@ +--- +on: + workflow_call: + +env: + PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + +jobs: + x86_64: + runs-on: [self-hosted, X64, Windows, parallels] + strategy: + fail-fast: false + matrix: + os: + - windows-11 + provider: + - parallels-iso + - qemu + - virtualbox-iso + - vmware-iso + steps: + - name: Checkout + uses: actions/checkout@main + - name: iso-availability + shell: pwsh + run: Invoke-RestMethod -Method Head -Verbose -Uri $(Get-Content os_pkrvars/$('${{ matrix.os }}'.split('-')[0])/${{ matrix.os }}-x86_64.pkrvars.hcl | ConvertFrom-StringData).iso_url.Trim('"') + # - name: Setup Packer + # uses: hashicorp/setup-packer@main + # with: + # version: latest + - name: Packer Init + run: packer init -upgrade packer_templates + - name: Packer FMT + run: if packer fmt -check -recursive .; then exit 0; else echo "Some packer files need to be formatted, run 'packer fmt -recursive .' to fix"; exit 1; fi + - name: Packer Validate + run: packer validate -var-file=os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates + - name: Packer build + # run: packer build -timestamp-ui -only=${{ matrix.provider }}.vm -var-file=os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates + run: | + eval "$(chef shell-init bash)" + bento build -o parallels-iso.vm,qemu.vm,virtualbox-iso.vm,vmware-iso.vm --vars "qemu_accelerator=hvf" os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" + ls -alh builds + # - name: Bento Test + # run: | + # eval "$(chef shell-init bash)" + # bento test + - name: Remove VM in case of canceled job + if: cancelled() + run: | + VM="$(prlctl list -a | grep ${{ matrix.os }} | cut -d " " -f 1)" + echo Powering off and deleting any existing VMs named ${{ matrix.os }}*-amd64 + prlctl stop "$VM" --kill 2> /dev/null + sleep 1 + prlctl delete "$VM" 2> /dev/null + sleep 2 + - name: Upload build artifact + if: always() + uses: actions/upload-artifact@v3 + with: + name: "${{ matrix.os }}-x86_64" + path: | + builds + !builds/uploaded/* + retention-days: 10 diff --git a/.github/workflows/pkr-bld-win-all.yml b/.github/workflows/pkr-bld-win-2016.yml similarity index 88% rename from .github/workflows/pkr-bld-win-all.yml rename to .github/workflows/pkr-bld-win-2016.yml index a4fff290f..f93f8d076 100644 --- a/.github/workflows/pkr-bld-win-all.yml +++ b/.github/workflows/pkr-bld-win-2016.yml @@ -12,11 +12,7 @@ jobs: fail-fast: false matrix: os: - - windows-10 - - windows-11 - windows-2016 - - windows-2019 - - windows-2022 provider: - parallels-iso - qemu @@ -42,7 +38,7 @@ jobs: # run: packer build -timestamp-ui -only=${{ matrix.provider }}.vm -var-file=os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates run: | eval "$(chef shell-init bash)" - bento build -o ${{ matrix.provider }}.vm os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" + bento build -o parallels-iso.vm,qemu.vm,virtualbox-iso.vm,vmware-iso.vm --vars "qemu_accelerator=hvf" os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" ls -alh builds # - name: Bento Test # run: | @@ -58,9 +54,10 @@ jobs: prlctl delete "$VM" 2> /dev/null sleep 2 - name: Upload build artifact + if: always() uses: actions/upload-artifact@v3 with: - name: "${{ matrix.os }}-all-x86_64" + name: "${{ matrix.os }}-x86_64" path: | builds !builds/uploaded/* diff --git a/.github/workflows/pkr-bld-win-2019.yml b/.github/workflows/pkr-bld-win-2019.yml new file mode 100644 index 000000000..0a980aae0 --- /dev/null +++ b/.github/workflows/pkr-bld-win-2019.yml @@ -0,0 +1,64 @@ +--- +on: + workflow_call: + +env: + PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + +jobs: + x86_64: + runs-on: [self-hosted, X64, Windows, parallels] + strategy: + fail-fast: false + matrix: + os: + - windows-2019 + provider: + - parallels-iso + - qemu + - virtualbox-iso + - vmware-iso + steps: + - name: Checkout + uses: actions/checkout@main + - name: iso-availability + shell: pwsh + run: Invoke-RestMethod -Method Head -Verbose -Uri $(Get-Content os_pkrvars/$('${{ matrix.os }}'.split('-')[0])/${{ matrix.os }}-x86_64.pkrvars.hcl | ConvertFrom-StringData).iso_url.Trim('"') + # - name: Setup Packer + # uses: hashicorp/setup-packer@main + # with: + # version: latest + - name: Packer Init + run: packer init -upgrade packer_templates + - name: Packer FMT + run: if packer fmt -check -recursive .; then exit 0; else echo "Some packer files need to be formatted, run 'packer fmt -recursive .' to fix"; exit 1; fi + - name: Packer Validate + run: packer validate -var-file=os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates + - name: Packer build + # run: packer build -timestamp-ui -only=${{ matrix.provider }}.vm -var-file=os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates + run: | + eval "$(chef shell-init bash)" + bento build -o parallels-iso.vm,qemu.vm,virtualbox-iso.vm,vmware-iso.vm --vars "qemu_accelerator=hvf" os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" + ls -alh builds + # - name: Bento Test + # run: | + # eval "$(chef shell-init bash)" + # bento test + - name: Remove VM in case of canceled job + if: cancelled() + run: | + VM="$(prlctl list -a | grep ${{ matrix.os }} | cut -d " " -f 1)" + echo Powering off and deleting any existing VMs named ${{ matrix.os }}*-amd64 + prlctl stop "$VM" --kill 2> /dev/null + sleep 1 + prlctl delete "$VM" 2> /dev/null + sleep 2 + - name: Upload build artifact + if: always() + uses: actions/upload-artifact@v3 + with: + name: "${{ matrix.os }}-x86_64" + path: | + builds + !builds/uploaded/* + retention-days: 10 diff --git a/.github/workflows/pkr-bld-win-2022.yml b/.github/workflows/pkr-bld-win-2022.yml new file mode 100644 index 000000000..5231b9f19 --- /dev/null +++ b/.github/workflows/pkr-bld-win-2022.yml @@ -0,0 +1,64 @@ +--- +on: + workflow_call: + +env: + PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + +jobs: + x86_64: + runs-on: [self-hosted, X64, Windows, parallels] + strategy: + fail-fast: false + matrix: + os: + - windows-2022 + provider: + - parallels-iso + - qemu + - virtualbox-iso + - vmware-iso + steps: + - name: Checkout + uses: actions/checkout@main + - name: iso-availability + shell: pwsh + run: Invoke-RestMethod -Method Head -Verbose -Uri $(Get-Content os_pkrvars/$('${{ matrix.os }}'.split('-')[0])/${{ matrix.os }}-x86_64.pkrvars.hcl | ConvertFrom-StringData).iso_url.Trim('"') + # - name: Setup Packer + # uses: hashicorp/setup-packer@main + # with: + # version: latest + - name: Packer Init + run: packer init -upgrade packer_templates + - name: Packer FMT + run: if packer fmt -check -recursive .; then exit 0; else echo "Some packer files need to be formatted, run 'packer fmt -recursive .' to fix"; exit 1; fi + - name: Packer Validate + run: packer validate -var-file=os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates + - name: Packer build + # run: packer build -timestamp-ui -only=${{ matrix.provider }}.vm -var-file=os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" packer_templates + run: | + eval "$(chef shell-init bash)" + bento build -o parallels-iso.vm,qemu.vm,virtualbox-iso.vm,vmware-iso.vm --vars "qemu_accelerator=hvf" os_pkrvars/$(echo ${{ matrix.os }} | cut -d "-" -f 1)/"${{ matrix.os }}-x86_64.pkrvars.hcl" + ls -alh builds + # - name: Bento Test + # run: | + # eval "$(chef shell-init bash)" + # bento test + - name: Remove VM in case of canceled job + if: cancelled() + run: | + VM="$(prlctl list -a | grep ${{ matrix.os }} | cut -d " " -f 1)" + echo Powering off and deleting any existing VMs named ${{ matrix.os }}*-amd64 + prlctl stop "$VM" --kill 2> /dev/null + sleep 1 + prlctl delete "$VM" 2> /dev/null + sleep 2 + - name: Upload build artifact + if: always() + uses: actions/upload-artifact@v3 + with: + name: "${{ matrix.os }}-x86_64" + path: | + builds + !builds/uploaded/* + retention-days: 10