-
Notifications
You must be signed in to change notification settings - Fork 130
138 lines (114 loc) · 4.46 KB
/
release-basetools.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# This workflow automatically publishes the basetools binaries for a given
# release.
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
name: BaseTools Build
on:
release:
types:
- published
pull_request:
branches:
- release/**
paths:
- ".github/workflows/release-basetools.yml"
- "BaseTools/**"
jobs:
build:
name: Build Base Tools
strategy:
matrix:
include:
- os: windows-2022
tool_chain: VS2022
output_dir: "BaseTools\\Bin\\Win32"
target: IA32
- os: windows-2022
tool_chain: VS2022
output_dir: "BaseTools\\Bin\\Win32"
target: ARM
- os: windows-2022
tool_chain: VS2022
output_dir: "BaseTools\\Bin\\Win64"
target: AARCH64
- os: ubuntu-20.04
tool_chain: GCC5
output_dir: "BaseTools/Source/C/bin"
target: X64
- os: ubuntu-20.04
tool_chain: GCC5
output_dir: "BaseTools/Source/C/bin"
target: AARCH64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Linux Tools
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi g++-aarch64-linux-gnu g++-arm-linux-gnueabi
echo "GCC5_AARCH64_PREFIX=/usr/bin/aarch64-linux-gnu-" >> "$GITHUB_ENV"
echo "GCC5_ARM_PREFIX=/usr/bin/arm-linux-gnueabi-" >> "$GITHUB_ENV"
- name: Install Pip Modules
run: pip install -r pip-requirements.txt --upgrade
- name: Stuart Setup
run: stuart_setup -c .pytool/CISettings.py
- name: Stuart Update
run: stuart_update -c .pytool/CISettings.py TOOL_CHAIN_TAG=${{ matrix.tool_chain}} -a ${{ matrix.target }}
- name: Build Base Tools
run: python BaseTools/Edk2ToolsBuild.py -t ${{ matrix.tool_chain}} -a ${{ matrix.target }} --skip_path_env
- name: Upload Build Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.tool_chain }}-${{ matrix.target }}
path: |
Build/SETUPLOG.txt
Build/UPDATE_LOG.txt
BaseTools/BaseToolsBuild/BASETOOLS_BUILD.txt
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: basetools-${{ matrix.tool_chain }}-${{ matrix.target }}
path: ${{ matrix.output_dir }}
publish:
name: Publish Base Tools
needs: build
if: github.event_name == 'release'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: ${{ runner.temp }}/artifacts
- name: Stage Files
run: mkdir ${{ runner.temp }}/basetools ;
mv ${{ runner.temp }}/artifacts/basetools-GCC5-X64 ${{ runner.temp }}/basetools/Linux-x86 ;
chmod a+x ${{ runner.temp }}/basetools/Linux-x86/* ;
mv ${{ runner.temp }}/artifacts/basetools-GCC5-AARCH64 ${{ runner.temp }}/basetools/Linux-ARM-64 ;
chmod a+x ${{ runner.temp }}/basetools/Linux-ARM-64/* ;
mv ${{ runner.temp }}/artifacts/basetools-VS2022-IA32 ${{ runner.temp }}/basetools/Windows-x86 ;
mv ${{ runner.temp }}/artifacts/basetools-VS2022-ARM ${{ runner.temp }}/basetools/Windows-ARM ;
mv ${{ runner.temp }}/artifacts/basetools-VS2022-AARCH64 ${{ runner.temp }}/basetools/Windows-ARM-64 ;
- name: Package Files
run: |
cd ${{ runner.temp }} ;
zip -r basetools-${{ github.event.release.tag_name }}.zip basetools/* ;
tar -czf basetools-${{ github.event.release.tag_name }}.tar.gz basetools/*
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.event.release.tag_name }} ${{ runner.temp }}/basetools-*.zip
gh release upload ${{ github.event.release.tag_name }} ${{ runner.temp }}/basetools-*.tar.gz