-
Notifications
You must be signed in to change notification settings - Fork 1
125 lines (109 loc) · 4.08 KB
/
artifacts.yml
File metadata and controls
125 lines (109 loc) · 4.08 KB
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
# Copyright (c) 2025 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
name: Artifacts
on:
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request.
pull_request:
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push.
push:
branches:
- '**'
tags-ignore:
- '**'
jobs:
build:
runs-on: ${{matrix.os}}
env:
BUILD_APP_TESTS: ON
strategy:
fail-fast: false
matrix:
os: [macos-14, ubuntu-24.04]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: MacOS Install Deps
if: contains(matrix.os, 'macos')
run: |
brew install ccache boost pkgconf libevent qt@6 qrencode coreutils
if [ "${BUILD_APP_TESTS}" = "ON" ]; then
brew install googletest
fi
echo "CCACHE_DIR=${{ runner.temp }}/ccache" >> "$GITHUB_ENV"
- name: Ubuntu Install Deps
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update && sudo apt-get install -y \
build-essential ccache cmake pkgconf \
libevent-dev libboost-dev libsqlite3-dev libgl-dev libqrencode-dev \
qt6-base-dev qt6-tools-dev qt6-l10n-tools qt6-tools-dev-tools \
qt6-declarative-dev qml6-module-qt-labs-settings qml6-module-qtquick qml6-module-qtquick-controls qml6-module-qtquick-dialogs qml6-module-qtquick-layouts qml6-module-qtquick-templates qml6-module-qtqml
if [ "${BUILD_APP_TESTS}" = "ON" ]; then
sudo apt-get install -y libgtest-dev libgmock-dev
fi
echo "CCACHE_DIR=${{ runner.temp }}/ccache" >> "$GITHUB_ENV"
- name: Restore Ccache cache
uses: actions/cache/restore@v4
id: ccache-cache
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ matrix.os }}-ccache-${{ github.run_id }}
restore-keys: ${{ matrix.os }}-ccache-
- name: Build
run: |
git submodule update --init
cmake -B build -DBUILD_APP_TESTS=${{ env.BUILD_APP_TESTS }}
cmake --build build -j$(nproc)
- name: Save Ccache cache
uses: actions/cache/save@v4
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ matrix.os }}-ccache-${{ github.run_id }}
- uses: actions/upload-artifact@v4
with:
name: unsecure_${{ matrix.os }}_gui
path: build/bin/bitcoin-core-app
publish-latest:
name: Publish latest release assets
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && github.ref_name == 'qt6'
permissions:
actions: read
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: dist
- name: Package artifacts
run: |
mkdir -p release
for artifact in dist/*; do
name="$(basename "$artifact")"
(cd "$artifact" && zip -r "../../release/${name}.zip" .)
done
- name: Create or update latest release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release view latest >/dev/null 2>&1 || \
gh release create latest \
--target "${GITHUB_SHA}" \
--title "Latest Bitcoin Core App preview" \
--notes "Latest unsigned preview artifacts from ${GITHUB_SHA}." \
--latest
gh api \
--method PATCH \
"repos/${GITHUB_REPOSITORY}/git/refs/tags/latest" \
-f sha="${GITHUB_SHA}" \
-F force=true
gh release upload latest release/*.zip --clobber
gh release edit latest \
--target "${GITHUB_SHA}" \
--notes "Latest unsigned preview artifacts from ${GITHUB_SHA}." \
--latest