forked from zxunge/x86-codeblocks-builds
-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (109 loc) · 4.5 KB
/
main64.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
name: main64
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
#push:
# branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: windows-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
update: true
msystem: MINGW64
location: D:\
install: >-
mingw-w64-x86_64-toolchain
libtool
automake-wrapper
autoconf-wrapper
mingw-w64-x86_64-tinyxml
mingw-w64-x86_64-drmingw
mingw-w64-x86_64-wxwidgets3.2-common-libs
mingw-w64-x86_64-wxwidgets3.2-common
mingw-w64-x86_64-wxwidgets3.2-msw
mingw-w64-x86_64-wxwidgets3.2-msw-libs
mingw-w64-x86_64-wxwidgets3.2-msw-cb_headers
base-devel
zip
git
mingw-w64-x86_64-hunspell
mingw-w64-x86_64-boost
unzip
mingw-w64-x86_64-wget
mingw-w64-x86_64-jq
- name: build codeblocks
shell: msys2 {0}
run: .ci/build.sh
# Get the latest release version and construct the download URL
- name: Get latest release version of pedeps tool
id: get_latest_release
shell: msys2 {0} # Use MSYS2 shell
run: |
# Fetch the latest release version from GitHub API and parse with jq
LATEST_VERSION=$(curl -s https://api.github.com/repos/brechtsanders/pedeps/releases/latest | jq -r .tag_name)
echo "Latest version is $LATEST_VERSION"
# Construct the download URL
DOWNLOAD_URL="https://github.com/brechtsanders/pedeps/releases/download/${LATEST_VERSION}/pedeps-${LATEST_VERSION}-win64.zip"
echo "DOWNLOAD_URL=${DOWNLOAD_URL}" >> $GITHUB_ENV
# Download and extract the specific pedeps release
- name: Download and extract pedeps
shell: msys2 {0} # Use MSYS2 shell
run: |
# Use the URL from the previous step to download the file
wget $DOWNLOAD_URL -O pedeps-latest.zip
# Unzip the downloaded file
unzip pedeps-latest.zip -d pedeps
# List contents of the pedeps directory to verify
ls -R pedeps
# Run copypedeps on codeblocks.exe
- name: Run copypedeps
shell: msys2 {0} # Use MSYS2 shell
run: |
# Execute copypedeps.exe if it exists
if [ -f pedeps/bin/copypedeps.exe ]; then
./pedeps/bin/copypedeps.exe -r -n -v /d/msys64/opt/codeblocks/bin/codeblocks.exe /d/msys64/opt/codeblocks/bin/
else
echo "copypedeps.exe is missing!"
exit 1
fi
# Step to handle all plugin .dll files and copy dependencies
- name: Copy dependencies for Code::Blocks plugins
shell: msys2 {0}
run: |
# Define the plugin directory and the destination directory
PLUGIN_DIR="/d/msys64/opt/codeblocks/lib/codeblocks/plugins/"
BIN_DIR="/d/msys64/opt/codeblocks/bin/"
# Loop through all .dll files in the plugin directory
for plugin in ${PLUGIN_DIR}*.dll; do
echo "Processing plugin: $plugin"
# Run copypedeps.exe to copy all the dependencies of the plugin
if [ -f pedeps/bin/copypedeps.exe ]; then
./pedeps/bin/copypedeps.exe -r -n -v "$plugin" "$BIN_DIR"
else
echo "copypedeps.exe is missing!"
exit 1
fi
# Get the plugin filename (without path)
plugin_filename=$(basename "$plugin")
# Delete the plugin DLL from the bin folder
if [ -f "$BIN_DIR$plugin_filename" ]; then
echo "Deleting copied plugin DLL: $BIN_DIR$plugin_filename"
rm "$BIN_DIR$plugin_filename"
else
echo "Plugin DLL $BIN_DIR$plugin_filename not found in bin folder."
fi
done
- uses: actions/upload-artifact@v4
with:
name: codeblocks64
path: D:\msys64\opt\codeblocks