Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OCE-Build pipeline #4

Merged
merged 26 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
83f31a5
Migrate build to new OCE-Build rewrite
Qonfused Feb 7, 2024
ee9a3cd
Remove old devcontainers
Qonfused Feb 7, 2024
7c31496
README: Vendor OpenCore version
Qonfused Feb 8, 2024
2ab0c7b
Add switches for legacy and 32-bit builds
Qonfused Feb 8, 2024
54e0645
Update build scripts
Qonfused Feb 9, 2024
503a079
Restore shellcheck analyze workflow
Qonfused Feb 9, 2024
42a77be
Update build pipeline to use new powershell workflow
Qonfused Feb 9, 2024
25b2206
Fix pwsh variable defs
Qonfused Feb 9, 2024
c849fc5
Fix pwsh invoke for ocvalidate step
Qonfused Feb 9, 2024
f9505f7
Update oce-build.yml
Qonfused Feb 9, 2024
3dc7ab3
Fix usage of zip
Qonfused Feb 9, 2024
b84f621
Update release workflow (testing)
Qonfused Feb 9, 2024
0e6700f
Fix typo in release workflow (testing)
Qonfused Feb 25, 2024
e595b71
Remove shellcheck workflow
Qonfused Feb 25, 2024
2ba83e9
Fix ls command (testing)
Qonfused Feb 25, 2024
f1d8d45
Test prerelease workflow
Qonfused Feb 25, 2024
53dd735
List output files (testing)
Qonfused Feb 25, 2024
727cae0
Fix path for release workflow notes
Qonfused Feb 25, 2024
96e7ce4
Update release tag to v0.1.0
Qonfused Feb 25, 2024
e37e68e
Upgrade release workflow action to use Node20
Qonfused Feb 25, 2024
54e1363
Sync changelog
Qonfused Feb 25, 2024
a5a698d
Fix escaping of back-slashes in ACPI patches
Qonfused Feb 25, 2024
9e6f8e0
Update release build script
Qonfused Feb 26, 2024
76eea88
Fix cleanup between builds
Qonfused Feb 26, 2024
ff1e1b7
Copy lockfile to build directory
Qonfused Feb 26, 2024
e9732e3
Fix build cleanup
Qonfused Feb 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .devcontainer/devcontainer.json

This file was deleted.

1 change: 1 addition & 0 deletions .env-example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GITHUB_TOKEN=
44 changes: 44 additions & 0 deletions .github/scripts/run-builds.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## @file
# EFI build script for OSX Hyper-V
#
# Copyright (c) 2023, Cory Bennett. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
##

# [CmdletBinding(PositionalBinding=$false)]
# param (
# [string]$pwd = "$((Get-Item "$PSScriptRoot\..").FullName)",
# # Script arguments
# [parameter(ValueFromRemainingArguments)][string[]]$arguments
# )

$buildList = @('RELEASE', 'DEBUG')
$flagsList = @(
@('--64-bit'),
@('legacy', '--32-bit'),
@('legacy', '--64-bit')
)

foreach ($build in $buildList) {
# Prepare for each build configuration
Remove-Item src\build.lock -ErrorAction SilentlyContinue
(Get-Content src\build.yml) -replace '^build: [A-Z]*', "build: $build" |
Set-Content src\build.yml

# Run build for each flag configuration
foreach ($flags in $flagsList) {
$identifier = "$($flags -replace '--', '' -join '-')-$build"

# Run build script
$flags = $($flags -join ' ')
Write-Host "Starting $build build with flags: $flags"
powershell.exe "$pwd\scripts\build.ps1" $flags

# Compress EFI directory
cp src\build.lock dist\EFI\OC\build.lock
tar.exe -czf "EFI-$env:TAG-$identifier.zip" -C dist .

# Cleanup
Remove-Item dist -Force -Recurse -ErrorAction SilentlyContinue
}
}
26 changes: 0 additions & 26 deletions .github/scripts/run-builds.sh

This file was deleted.

12 changes: 0 additions & 12 deletions .github/scripts/shellcheck.sh

This file was deleted.

51 changes: 0 additions & 51 deletions .github/workflows/analyze.yml

This file was deleted.

40 changes: 12 additions & 28 deletions .github/workflows/oce-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
paths:
- '!.github/**'
- '!docs/**'
- '!.gitmodules'
- '!.gitattributes'
- '!.gitignore'
- 'src/**'
Expand All @@ -29,50 +28,32 @@ on:
# Refer to the GitHub docs page for more information on this topic:
# * https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Run OCE-Build
timeout-minutes: 10
runs-on: ubuntu-latest
runs-on: windows-latest
outputs:
LOCKFILE_HASH: ${{ steps.prepare-efi.outputs.LOCKFILE_HASH }}
steps:
# Installs dependencies needed for running OCE-Build.
#
# This includes the following required commands:
# - libarchive-tools:
# - **BSDTAR**: Used for unarchiving .zip files.
# - acpica-tools:
# - **iasl**: Required for compiling .dsl files.
- name: Install OCE-Build dependencies
if: runner.os == 'Linux'
run: |
sudo apt install -qq -o=Dpkg::Use-Pty=0 \
libarchive-tools \
acpica-tools
# Fetches remote repository without --progress option.
#
# The default behavior of @actions/checkout outputs many noisy lines of
# status output in the workflow log, which is problematic for log size.
#
# Refer to the below PR for updates on this issue:
# - https://github.com/actions/checkout/pull/1067
- name: Checkout latest repository commit
# uses: actions/checkout@v3
uses: simonbaird/checkout@no-progress-option
uses: actions/checkout@v4
with:
show-progress: false
submodules: recursive
# Runs EFI build pipeline using OCE-Build.
#
# Build **dist** directory containing **dist/EFI** and **dist/scripts**
# Build **dist** directory containing **dist/EFI** and **dist/Utilities**
# folders needed for downstream build tasks.
- id: oce-build
name: Run OCE-Build
shell: sh
run: bash scripts/build.sh --skip-serial
shell: pwsh
run: .\scripts\build.ps1 -v
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Runs quick validation of config.plist and EFI structure.
Expand All @@ -82,8 +63,11 @@ jobs:
# any machine testable issues.
- id: validate-efi
name: Validate OCE-Build output
shell: sh
run: bash scripts/lib/oce-build/scripts/validate-efi.sh -c src/config.yml
shell: pwsh
run: |
$OCVALIDATE = 'dist\Utilities\ocvalidate\ocvalidate.exe';
$PLIST_PATH = 'dist\EFI\OC\config.plist';
Start-Process -Wait $OCVALIDATE -NoNewWindow -ArgumentList $PLIST_PATH;
# Handles compression and lock-hash generation for upload task.
#
# This stores a hash of the output build's lockfile to associate with the
Expand All @@ -99,7 +83,7 @@ jobs:
# Copy lockfile to EFI directory
cp src/build.lock dist/EFI/build.lock
# Compress EFI directory
zip -r -X EFI.zip dist/EFI
tar.exe -czf EFI.zip -C dist/EFI .
# Upload built EFI as artifact
#
# Uploads EFI with a short-sha slug. The uploaded EFI will be available
Expand Down
34 changes: 9 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,16 @@ permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
# Installs dependencies needed for running OCE-Build.
#
# This includes the following required commands:
# - libarchive-tools:
# - **BSDTAR**: Used for unarchiving .zip files.
# - acpica-tools:
# - **iasl**: Required for compiling .dsl files.
- name: Install OCE-Build dependencies
if: runner.os == 'Linux'
run: |
sudo apt install -qq -o=Dpkg::Use-Pty=0 \
libarchive-tools \
acpica-tools
# Fetches remote repository without --progress option.
#
# The default behavior of @actions/checkout outputs many noisy lines of
# status output in the workflow log, which is problematic for log size.
#
# Refer to the below PR for updates on this issue:
# - https://github.com/actions/checkout/pull/1067
- name: Checkout latest repository commit
# uses: actions/checkout@v3
uses: simonbaird/checkout@no-progress-option
uses: actions/checkout@v4
with:
show-progress: false
submodules: recursive
# Generate Changelog notes and release info
- id: get-tag
name: Fetches latest release tag
Expand All @@ -45,8 +27,8 @@ jobs:
# folders needed for downstream build tasks.
- id: oce-build
name: Run OCE-Build for all build targets
shell: sh
run: bash .github/scripts/run-builds.sh
shell: pwsh
run: .\.github\scripts\run-builds.ps1
env:
TAG: ${{ env.TAG }}
# Generate Changelog notes and release info
Expand All @@ -55,16 +37,18 @@ jobs:
shell: sh
run: |
BODY="$(sed -n "/## \[$TAG\]/,/## \[/p" docs/CHANGELOG.md | sed -e '1,2d;$d')"
echo "$BODY" > ${{ github.workspace }}-RELEASE_NOTES.txt
echo "$BODY" > RELEASE_NOTES.txt
env:
TAG: ${{ env.TAG }}
# Publish release
- name: Create Release
uses: softprops/action-gh-release@v1
# uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@4634c16e79c963813287e889244c50009e7f0981
with:
name: v${{ env.TAG }}
tag_name: ${{ env.TAG }}
body_path: ${{ github.workspace }}-RELEASE_NOTES.txt
body_path: RELEASE_NOTES.txt
prerelease: true
files: |
EFI-${{ env.TAG }}-64-bit-DEBUG.zip
EFI-${{ env.TAG }}-64-bit-RELEASE.zip
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
.*
!/.devcontainer/
!/.github/
!/.vscode/
!/.env-example
!/.gitattributes
!/.gitignore
!/.gitmodules

# Build config files
!.serialdata.example
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

35 changes: 34 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,37 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

The latest progress can be viewed on this repository's [project board](#).

## [0.0.0] - Unreleased
## [0.1.0] - Unreleased

> [!NOTE]
> This release is currently in development and is not recommended for use.

### Changed
- Migrate build to new OCE-Build rewrite ([`83f31a5`](https://github.com/Qonfused/OSX-Hyper-V/pull/4/commits/83f31a53f26d0d3451ffc9215564bc8e156cb8cb))
- Updated build pipeline to use new powershell workflow ([`42a77be`](https://github.com/Qonfused/OSX-Hyper-V/pull/4/commits/42a77be235c4bccccf6664708b5547bd68008147))

### Added
- Added switches for legacy and 32-bit builds ([`2ab0c7b`](https://github.com/Qonfused/OSX-Hyper-V/pull/4/commits/2ab0c7b2b214886be6c2cc6da0595e4ff1e08b2a))

### Removed
- Removed old devcontainers ([`ee9a3cd`](https://github.com/Qonfused/OSX-Hyper-V/pull/4/commits/ee9a3cdcae8bf1322502705bc39f43429db2da13))

## [0.0.0] - 2023-06-15

Initial release of the project containing bug fixes, feature and documentation improvements to the original [MacHyperVSupport](https://github.com/acidanthera/MacHyperVSupport) project:

### Changed
- Updated scanpolicy for consistent installer detection ([`8f838a2`](https://github.com/Qonfused/OSX-Hyper-V/commit/8f838a2342af58ccc568ac590f850df6771c6eb9))
- Configure network adapter to use default vswitch ([`1ce9be2`](https://github.com/Qonfused/OSX-Hyper-V/commit/1ce9be20a0e7f2a1a7980b5c9f80003bf228c9b9))
- Disabled automatic checkpoints ([`de3c6ab`](https://github.com/Qonfused/OSX-Hyper-V/commit/de3c6ab29b2b9903c1e2281f6b1d8a6fe98373a8))

### Added
- Added separate `--legacy` patch for 10.7 and below ([`468bef2`](https://github.com/Qonfused/OSX-Hyper-V/commit/468bef2c552e661982de3c7cb8091a1ddd9fd495))
- Added small boot fixes and security fixes ([`2764ade`](https://github.com/Qonfused/OSX-Hyper-V/commit/2764ade116b944e8b8ace6dbf183609356d8c02e))
- Added powershell scripts for VM creation automation ([`6badacf`](https://github.com/Qonfused/OSX-Hyper-V/commit/6badacfccf32c3a818fe5ea61eddbad04c8d9738))
- Added post-install daemons and tools to EFI VHD ([`c426d92`](https://github.com/Qonfused/OSX-Hyper-V/commit/c426d928ba7d2afe4bee16b8c56244668d9fec2b))
- Added post-install VHD creation ([`f2415d4`](https://github.com/Qonfused/OSX-Hyper-V/commit/f2415d41160f79d66591fe4dda1532aa92b6c9c0))

### Fixed
- Fixed recovery image packing script ([`46bfb01`](https://github.com/Qonfused/OSX-Hyper-V/commit/46bfb01c4c38abc0a75f3d5ae410184538754c6a))
- Fixed patch-serial script for linux/WSL2 ([`7557d71`](https://github.com/Qonfused/OSX-Hyper-V/commit/7557d713a5a0551ccd5ac0c40fc0356a1cac1dc5))
Loading
Loading