This repository has been archived by the owner on Feb 12, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
97 lines (97 loc) · 3.28 KB
/
nix_release_builds.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
name: "Package libcore"
on:
workflow_dispatch:
inputs:
release:
description: Create Release JAR package (instead of SNAPSHOT). Version number will be taken from CMakeLists.txt
required: true
type: boolean
default: false
version:
description: Custom version of jar package (applies only if `release` is true)
required: false
type: string
macos:
description: Build macos into jar
required: false
type: boolean
default: true
workflow_call:
inputs:
release:
required: false
type: boolean
version:
required: false
type: string
macos:
required: false
type: boolean
default: true
jobs:
libcore_version:
name: Compute libcore version
runs-on: ubuntu-latest
outputs:
lib_version: ${{ steps.lib_version.outputs.lib_version }}
deploy_dynlibs: ${{ steps.lib_version.outputs.deploy_dynlibs }}
jar_version: ${{ steps.lib_version.outputs.jar_version }}
steps:
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0 # By default action fetches only a single commit.
# fetch-depth=0 forces to fetch all history and tags.
# nix/scripts/export_libcore_version.sh requires git history
# https://github.com/actions/checkout/blob/v2.3.4/README.md
- name: Set version slug and push_to_S3 flags
id: lib_version
run: bash nix/scripts/export_libcore_version.sh
env:
RELEASE: ${{ inputs.release || 'false' }}
VERSION: ${{ inputs.version }}
Build_Release_JNI:
name: Build Release with JNI
uses: ./.github/workflows/tests.yml
secrets: inherit # pass all secrets
with:
buildJni: 'ON'
buildMacos: ${{ inputs.macos }}
JAR:
name: Jar build
needs: [libcore_version, Build_Release_JNI]
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/lib-ledger-core-build-env/lib-ledger-core-build-env:1.0.3
credentials:
username: ${{ secrets.CI_BOT_USERNAME }}
password: ${{ secrets.CI_BOT_TOKEN }}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2.3.4
with:
submodules: 'recursive'
- run: mkdir -p jar_build/src/main/resources/resources/djinni_native_libs
- name: Fetch Linux so
uses: actions/download-artifact@v2
with:
name: linux-ubuntu-22.04-libledgercore
path: jar_build/src/main/resources/resources/djinni_native_libs
- name: Fetch MacOS dylib
if: ${{ inputs.macos }}
uses: actions/download-artifact@v2
with:
name: macos-libledgercore
path: jar_build/src/main/resources/resources/djinni_native_libs
- run: bash nix/scripts/build_jar.sh
env:
GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }}
JAR_VERSION: ${{ needs.libcore_version.outputs.jar_version }}
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: ${{ needs.libcore_version.outputs.lib_version }}-ledger-lib-core.jar
path: jar_build/artifact/ledger-lib-core.jar
retention-days: 90