Skip to content

Commit ee4dc7d

Browse files
committed
Merge #365: ci, gha: Build macOS and Windows artifacts
734ea40 ci, gha: Build macOS and Windows artifacts (Hennadii Stepanov) Pull request description: This PR reintroduces downloadable binary artifacts for macOS and Windows as it was on now decommissioned Cirrus CI. Here are a few implementation details: - A separated workflows allows to get artifact available quicker without waiting for the CI workflow. - Using a custom patch to avoid bitcoin/bitcoin#21552. --- The artifacts are available for downloading from https://github.com/bitcoin-core/gui-qml/actions/workflows/artifacts.yml. Also refer to GitHub's documentation: https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts. Links for macOS and Windows build artifacts: [![macOS Apple Silicon](https://img.shields.io/badge/OS-macOS%20Apple%20Silicon-green)](https://github.com/bitcoin-core/gui-qml/suites/15993681320/artifacts/913114919) [![macOS Intel](https://img.shields.io/badge/OS-macOS%20Intel-green)](https://github.com/bitcoin-core/gui-qml/suites/15993681320/artifacts/913114920) [![Windows](https://img.shields.io/badge/OS-Windows-green)](https://github.com/bitcoin-core/gui-qml/suites/15993681320/artifacts/913114921) ACKs for top commit: jarolrod: ACK 734ea40 Tree-SHA512: fdff0b8d0c169f4bea58cfed871f4771219095e2618d02e678c2f373b1df16f603f81aeb55f0033eb88d9c1cbb1fdfe796f512c616bc20d08cad7db601bb54ae
2 parents 72d144f + 734ea40 commit ee4dc7d

File tree

3 files changed

+154
-1
lines changed

3 files changed

+154
-1
lines changed

.github/workflows/artifacts.yml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Copyright (c) 2023 The Bitcoin Core developers
2+
# Distributed under the MIT software license, see the accompanying
3+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+
name: Artifacts
6+
on:
7+
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request.
8+
pull_request:
9+
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push.
10+
push:
11+
branches:
12+
- '**'
13+
tags-ignore:
14+
- '**'
15+
16+
concurrency:
17+
group: ${{ github.workflow }}${{ github.event_name != 'pull_request' && github.run_id || github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
cross-build:
22+
name: ${{ matrix.host.name }}
23+
runs-on: ubuntu-latest
24+
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
host:
29+
- name: 'macOS arm64'
30+
packages: ''
31+
triplet: 'arm64-apple-darwin'
32+
compiler: 'clang'
33+
configure_options: ''
34+
gui_exe: 'bitcoin-qt'
35+
artifact: 'unsecure_macos_apple_silicon_gui'
36+
- name: 'macOS x86_64'
37+
packages: ''
38+
triplet: 'x86_64-apple-darwin'
39+
compiler: 'clang'
40+
configure_options: ''
41+
gui_exe: 'bitcoin-qt'
42+
artifact: 'unsecure_macos_intel_gui'
43+
- name: 'Windows'
44+
packages: 'g++-mingw-w64-x86-64-posix'
45+
triplet: 'x86_64-w64-mingw32'
46+
compiler: 'x86_64-w64-mingw32-g++-posix'
47+
configure_options: 'CXXFLAGS=-Wno-return-type'
48+
gui_exe: 'bitcoin-qt.exe'
49+
artifact: 'unsecure_windows_gui'
50+
51+
env:
52+
XCODE_VERSION: '12.2'
53+
XCODE_BUILD_ID: '12B45b'
54+
CCACHE_MAXSIZE: '30M'
55+
56+
steps:
57+
- name: Checkout
58+
uses: actions/checkout@v4
59+
60+
- name: Install dependency packages
61+
run: |
62+
sudo apt-get update
63+
sudo apt-get install ccache ${{ matrix.host.packages }}
64+
echo "CCACHE_DIR=${{ runner.temp }}/ccache" >> "$GITHUB_ENV"
65+
66+
- name: Depends fingerprint
67+
id: depends_fingerprint
68+
run: |
69+
if ${{ !endsWith(matrix.host.triplet, '-apple-darwin') }}; then ${{ matrix.host.compiler }} -v 2>&1 | tee depends/compiler-version; fi
70+
if ${{ endsWith(matrix.host.triplet, '-apple-darwin') }}; then echo ${{ env.XCODE_VERSION }} ${{ env.XCODE_BUILD_ID }} > depends/sdk-version; fi
71+
echo "hash=${{ hashFiles('./depends/**') }}" >> "$GITHUB_OUTPUT"
72+
73+
- name: Depends cache
74+
id: depends_cache
75+
uses: actions/cache@v3
76+
with:
77+
path: |
78+
depends/built
79+
depends/SDKs
80+
key: ${{ matrix.host.triplet }}-depends-${{ steps.depends_fingerprint.outputs.hash }}
81+
82+
- name: Fetch SDK
83+
if: endsWith(matrix.host.triplet, '-apple-darwin') && steps.depends_cache.outputs.cache-hit != 'true'
84+
run: |
85+
curl --location --fail https://bitcoincore.org/depends-sources/sdks/Xcode-${{ env.XCODE_VERSION }}-${{ env.XCODE_BUILD_ID }}-extracted-SDK-with-libcxx-headers.tar.gz -o sdk.tar.gz
86+
mkdir depends/SDKs
87+
tar -C depends/SDKs -xf sdk.tar.gz
88+
89+
- name: Build depends
90+
run: |
91+
patch -p1 -i ci/hosts_darwin_mk.patch
92+
cd depends
93+
make -j$(nproc) HOST=${{ matrix.host.triplet }} LOG=1
94+
95+
- name: Restore Ccache cache
96+
uses: actions/cache/restore@v3
97+
id: ccache-cache
98+
with:
99+
path: ${{ env.CCACHE_DIR }}
100+
key: ${{ matrix.host.triplet }}-ccache-${{ github.run_id }}
101+
restore-keys: ${{ matrix.host.triplet }}-ccache-
102+
103+
- name: Configure
104+
run: |
105+
./autogen.sh
106+
./configure CONFIG_SITE=${{ github.workspace }}/depends/${{ matrix.host.triplet }}/share/config.site --disable-dependency-tracking --enable-werror ${{ matrix.host.configure_options }} || (cat config.log; false)
107+
108+
- name: Build GUI
109+
run: |
110+
ccache --zero-stats
111+
make -j$(nproc) src/qt/${{ matrix.host.gui_exe }}
112+
ccache --version | head -n 1 && ccache --show-stats
113+
114+
- name: Save Ccache cache
115+
uses: actions/cache/save@v3
116+
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
117+
with:
118+
path: ${{ env.CCACHE_DIR }}
119+
key: ${{ matrix.host.triplet }}-ccache-${{ github.run_id }}
120+
121+
- uses: actions/upload-artifact@v3
122+
with:
123+
name: ${{ matrix.host.artifact }}
124+
path: src/qt/${{ matrix.host.gui_exe }}

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
- '**'
1515

1616
concurrency:
17-
group: ${{ github.event_name != 'pull_request' && github.run_id || github.ref }}
17+
group: ${{ github.workflow }}${{ github.event_name != 'pull_request' && github.run_id || github.ref }}
1818
cancel-in-progress: true
1919

2020
env:

ci/hosts_darwin_mk.patch

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
macos: Fix Ccache issue
2+
3+
See:
4+
- https://github.com/bitcoin/bitcoin/issues/21552
5+
- https://github.com/ccache/ccache/issues/1326
6+
7+
--- a/depends/hosts/darwin.mk
8+
+++ b/depends/hosts/darwin.mk
9+
@@ -72,18 +72,12 @@ $(foreach TOOL,$(cctools_TOOLS),$(eval darwin_$(TOOL) = $$(build_prefix)/bin/$$(
10+
# Adds the desired paths from the SDK
11+
#
12+
13+
-darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
14+
- -u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
15+
- -u LIBRARY_PATH \
16+
- $(clang_prog) --target=$(host) -mmacosx-version-min=$(OSX_MIN_VERSION) \
17+
+darwin_CC=$(clang_prog) --target=$(host) -mmacosx-version-min=$(OSX_MIN_VERSION) \
18+
-B$(build_prefix)/bin -mlinker-version=$(LD64_VERSION) \
19+
-isysroot$(OSX_SDK) -nostdlibinc \
20+
-iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks
21+
22+
-darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
23+
- -u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
24+
- -u LIBRARY_PATH \
25+
- $(clangxx_prog) --target=$(host) -mmacosx-version-min=$(OSX_MIN_VERSION) \
26+
+darwin_CXX=$(clangxx_prog) --target=$(host) -mmacosx-version-min=$(OSX_MIN_VERSION) \
27+
-B$(build_prefix)/bin -mlinker-version=$(LD64_VERSION) \
28+
-isysroot$(OSX_SDK) -nostdlibinc \
29+
-iwithsysroot/usr/include/c++/v1 \

0 commit comments

Comments
 (0)