forked from apache/netbeans
-
Notifications
You must be signed in to change notification settings - Fork 0
210 lines (173 loc) · 7.1 KB
/
native-binary-build-launcher.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------
#
# This workflow builds the native Windows launchers for the IDE and platform.
#
# The result of the build are files 'launcher-external-sources.zip'
# and 'launcher-external-binaries.zip' which can be downloaded from
# the GitHub Actions UI and prepared for release to be used by the Ant build
# scripts for the NetBeans distribution.
#
# ----------------------
name: NetBeans Native Launcher
on:
push:
# Triggers the workflow on push or pull request events but only for
# relevant paths
paths:
- .github/workflows/native-binary-build-launcher.y*
- platform/o.n.bootstrap/launcher/windows/**
- harness/apisupport.harness/windows-launcher-src/**
- nb/ide.launcher/windows/**
pull_request:
paths:
- .github/workflows/native-binary-build-launcher.y*
- platform/o.n.bootstrap/launcher/windows/**
- harness/apisupport.harness/windows-launcher-src/**
- nb/ide.launcher/windows/**
# Allows you to run this workflow manually from the Actions tab in GitHub UI
workflow_dispatch:
# cancel other PR workflow run in the same head-base group if it exists (e.g. during PR syncs)
# if this is not a PR run (no github.head_ref and github.base_ref defined), use an UID as group
concurrency:
group: launcher-${{ github.head_ref || github.run_id }}-${{ github.base_ref }}
cancel-in-progress: true
jobs:
source:
name: Package Sources
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
submodules: false
show-progress: false
- name: Generate source bundle
run: |
SOURCES="nbbuild/build/native/launcher/sources"
mkdir -p ${SOURCES}/platform/o.n.bootstrap/launcher/
cp -r platform/o.n.bootstrap/launcher/windows/ ${SOURCES}/platform/o.n.bootstrap/launcher/
mkdir -p ${SOURCES}/harness/apisupport.harness/
cp -r harness/apisupport.harness/windows-launcher-src/ ${SOURCES}/harness/apisupport.harness/
mkdir -p ${SOURCES}/nb/ide.launcher/
cp -r nb/ide.launcher/windows/ ${SOURCES}/nb/ide.launcher/
cp LICENSE ${SOURCES}/LICENSE
cp NOTICE ${SOURCES}/NOTICE
ls -l -R ${SOURCES}
- name: Upload native sources
uses: actions/upload-artifact@v4
with:
name: launcher-external-sources
path: nbbuild/build/native/launcher/sources/
if-no-files-found: error
build-linux:
name: Build with MinGW
runs-on: ubuntu-latest
needs: source
steps:
- name: Install MinGW
run: sudo apt install mingw-w64 mingw-w64-tools
- name: Download sources
uses: actions/download-artifact@v4
with:
name: launcher-external-sources
- name: Build bootstrap binaries
run: |
echo "Building bootstrap binaries"
rm -rf ./build/
make -f Makefile.mingw
ls -l -R ./build/
echo "done"
working-directory: platform/o.n.bootstrap/launcher/windows/
- name: Upload bootstrap artifacts
uses: actions/upload-artifact@v4
with:
name: launcher-bootstrap-bin
path: platform/o.n.bootstrap/launcher/windows/build/
if-no-files-found: error
- name: Build harness binaries
run: |
echo "Building harness binaries"
rm -rf ./build/
make -f Makefile.mingw
ls -l -R ./build/
echo "done"
working-directory: harness/apisupport.harness/windows-launcher-src
- name: Upload harness artifacts
uses: actions/upload-artifact@v4
with:
name: launcher-harness-bin
path: harness/apisupport.harness/windows-launcher-src/build/
if-no-files-found: error
- name: Build IDE binaries
run: |
echo "Building IDE binaries"
rm -rf ./build/
make -f Makefile.mingw
ls -l -R ./build/
echo "done"
working-directory: nb/ide.launcher/windows
- name: Upload IDE artifacts
uses: actions/upload-artifact@v4
with:
name: launcher-ide-bin
path: nb/ide.launcher/windows/build/
if-no-files-found: error
build-zip-with-build-artifacts:
name: Package Binaries
runs-on: ubuntu-latest
# Only run when the platform specific builds are finished
needs: [build-linux]
steps:
- name: Create dir structure
run: mkdir -p myfiles/
- name: Download artifacts from predecessor jobs
uses: actions/download-artifact@v4
with:
path: myfiles/
- name: Tidy up and display artifacts
run: |
cp myfiles/launcher-external-sources/LICENSE myfiles/LICENSE
cp myfiles/launcher-external-sources/NOTICE myfiles/NOTICE
cp myfiles/*bin/*.exe myfiles/
cp myfiles/*bin/*.dll myfiles/
rm -rf myfiles/*-sources/
rm -rf myfiles/*-bin/
ls -l -R
- name: Create BUILDINFO
run: |
BUILDINFO="myfiles/BUILDINFO.txt"
touch "$BUILDINFO"
echo "Apache NetBeans" >> "$BUILDINFO"
echo "" >> "$BUILDINFO"
echo "Binaries in this ZIP are..." >> "$BUILDINFO"
echo "Build by GitHub Actions Workflow: ${GITHUB_WORKFLOW}" >> "$BUILDINFO"
echo "" >> "$BUILDINFO"
echo "Build from:" >> "$BUILDINFO"
echo " Git repo : ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" >> "$BUILDINFO"
echo " Git commit SHA : ${GITHUB_SHA}" >> "$BUILDINFO"
echo " Git ref : ${GITHUB_REF}" >> "$BUILDINFO"
echo "" >> "$BUILDINFO"
echo "Build time UTC : $(date --rfc-3339=seconds --utc)" >> "$BUILDINFO"
echo "" >> "$BUILDINFO"
- name: Upload bundle
uses: actions/upload-artifact@v4
with:
name: launcher-external-binaries
path: myfiles/
if-no-files-found: error