Skip to content

Commit 15a209c

Browse files
authored
Optionally Create Build Artefacts (#201)
* Build and Upload Workflow Artefacts
1 parent e14d970 commit 15a209c

File tree

1 file changed

+110
-0
lines changed

1 file changed

+110
-0
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Build and Upload Artefacts
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
commit_id:
7+
description: "Commit ID (leave blank for GOPFix latest)"
8+
required: false
9+
type: number
10+
11+
jobs:
12+
build-macos:
13+
name: Build on macOS
14+
runs-on: macos-13
15+
16+
steps:
17+
- name: Checkout Repository
18+
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.event.inputs.commit_id || 'GOPFix' }}
21+
22+
- name: Install Python 2.7
23+
run: |
24+
curl -O https://www.python.org/ftp/python/2.7.18/python-2.7.18-macosx10.9.pkg
25+
sudo installer -pkg python-2.7.18-macosx10.9.pkg -target /
26+
27+
- name: Install Xcode Command Line Tools
28+
run: |
29+
xcode-select --install || true
30+
31+
- name: Prepare Build Environment
32+
run: |
33+
if [[ "${PATH}" != *"/usr/local/bin"* ]] ; then export PATH="/usr/local/bin:${PATH}"; fi
34+
brew install nasm
35+
brew install acpica
36+
brew install ocmtoc
37+
38+
- name: Create Directory Structure
39+
run: |
40+
mkdir -p ~/Documents/RefindPlus
41+
42+
- name: Clone RefindPlus Repository
43+
run: |
44+
cd ~/Documents/RefindPlus
45+
git clone https://github.com/${{ github.repository_owner }}/RefindPlus.git Working
46+
cd Working
47+
48+
# Determine which branch contains the commit
49+
if [ ! -n "${{ github.event.inputs.commit_id }}" ]; then
50+
BRANCH=GOPFix
51+
git checkout GOPFix
52+
else
53+
BRANCH=$(git branch -r --contains ${{ github.event.inputs.commit_id }} | grep -v 'HEAD' | head -n 1 | sed 's/origin\///')
54+
if [ -z "$BRANCH" ]; then
55+
echo "Error: Commit ID not found in any remote branches!"
56+
exit 1
57+
fi
58+
git checkout "$BRANCH"
59+
git reset --hard ${{ github.event.inputs.commit_id }}
60+
fi
61+
62+
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
63+
64+
- name: Clone RefindPlusUDK Repository
65+
run: |
66+
cd ~/Documents/RefindPlus
67+
git clone https://github.com/${{ github.repository_owner }}/RefindPlusUDK.git edk2
68+
cd edk2
69+
git checkout rudk
70+
71+
- name: Run Build Script
72+
env:
73+
TERM: xterm
74+
run: |
75+
cd ~/Documents/RefindPlus/edk2/000-BuildScript
76+
chmod +x RefindPlusBuilder.sh
77+
sh RefindPlusBuilder.sh "${BRANCH}" ALL
78+
79+
- name: Archive RELEASE Build Artefacts
80+
if: success()
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: RefindPlus_Artefacts_REL
84+
path: ~/Documents/RefindPlus/edk2/Build/RefindPlus/RELEASE_XCODE5
85+
if-no-files-found: warn
86+
compression-level: 6
87+
overwrite: false
88+
include-hidden-files: false
89+
90+
- name: Archive DEBUG Build Artefacts
91+
if: success()
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: RefindPlus_Artefacts_DBG
95+
path: ~/Documents/RefindPlus/edk2/Build/RefindPlus/DEBUG_XCODE5
96+
if-no-files-found: warn
97+
compression-level: 6
98+
overwrite: false
99+
include-hidden-files: false
100+
101+
- name: Archive NOOPT Build Artefacts
102+
if: success()
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: RefindPlus_Artefacts_NPT
106+
path: ~/Documents/RefindPlus/edk2/Build/RefindPlus/NOOPT_XCODE5
107+
if-no-files-found: warn
108+
compression-level: 6
109+
overwrite: false
110+
include-hidden-files: false

0 commit comments

Comments
 (0)