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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add ccache to github actions builds * incrase cache size * Add ccache to buildInputs * Try to remove nix to build & run tests * run on all branches on push * run on all branches on push * fix image name * use other credentials ? * fix cli * Use ninja * Use sys ssl * add postgres service * temporarily change url for tests * build postgres url from env * Add macos build * Try to fix macos build * Upload cmake artifacts * add PGsql include dir * Rollback to pg 13 * Rollback to pg 13 on macos It seems to be related to update on brew package 14.5: Homebrew/homebrew-core@8060df9 * Rollback to pg 13 on macos It seems to be related to update on brew package 14.5: Homebrew/homebrew-core@8060df9 * Enable unixes * Cancel previous macos runs * Remove ccache from nix_release_builds.yml * don't use sys openssl on macos * Revert "don't use sys openssl on macos" This reverts commit 6cc934f. * fix db connection on macos * fix incldue path * Keep circleci only on main * remove appveyor.yml * run clang-format-check only on push & cancel previsou runs * Add more parameters to release workflow * fix workflow condition syntax * don't run nix_release_builds.yml on branches except manually asked for * Rename build * Add jar package workflow * Pass secrets * executable scripts * Publish to WD * update ccache keys * fix secret for publish & call publish workflow on Release * fix need dependency * fix checkout * fix checkout * reorder checkout to avoid clean * fetch ? * fix checkout * add some debug command to understand what is going on here * do not update submodule for now * add missing env var * update token * Update version numbers * print more * print more * fix empty var * update sbt version * Add script to publish jar locally * Don't use unique version number for snapshots * try to build in release instead of debug * some cleanings & version set * Revert "Don't use unique version number for snapshots" This reverts commit 2408538. * remove job to create WD PR * run linting only if updating code * print for debug * fix clang tidy condition * clang format on pull requests only * Revert "remove job to create WD PR" This reverts commit 637ad3b. * Create PR with bump of jar version * Revert "Create PR with bump of jar version" This reverts commit 1432199. * fix sigpipe error * Publish to WD on manual release * Rollback unused changes * Add documentation * Run package only manually & on call * Update build env * clean unused changes * Update after review
- Loading branch information
Showing
26 changed files
with
390 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
mkdir _build_tests | ||
cd _build_tests | ||
cmake .. -DTARGET_JNI=${BUILD_JNI-OFF} -DBUILD_TESTS=ON -DNIX_BUILD=OFF -DCCACHE=ON -DSYS_OPENSSL=ON -DOPENSSL_USE_STATIC_LIBS=TRUE -GNinja | ||
echo "========= Building libcore" | ||
cmake --build . --parallel --target ledger-core-static | ||
cmake --build . --parallel --target ledger-core | ||
cmake --build . --parallel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
cd $GITHUB_WORKSPACE/ledger-wallet-daemon | ||
|
||
# Bump libcore version | ||
sed -i -E 's/(val libcore *= *\")(.*)\"/\1'$VERSION'\"/' build.sbt | ||
|
||
# Commit & push changes | ||
git checkout -b bump_libcore_$VERSION | ||
git add lib # libcore | ||
git config --global user.name "${GITHUB_ACTOR}" | ||
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
git commit -m "Bump libcore to $VERSION" | ||
git push --set-upstream origin bump_libcore_$VERSION | ||
gh pr create --title "Bump libcore to $VERSION" \ | ||
--body "Automatic update from libcore release" \ | ||
--base main \ | ||
--head bump_libcore_$VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
cd _build_tests | ||
ctest --output-on-failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
name: clang-format Check | ||
on: [push, pull_request] | ||
on: | ||
pull_request: | ||
paths: | ||
- core/** | ||
- .clang-format | ||
- .github/workflows/clang-format-check.yml | ||
jobs: | ||
formatting-check: | ||
name: Formatting Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/checkout@v2 | ||
- name: Run clang-format style check for C/C++/Protobuf programs. | ||
uses: jidicula/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,28 @@ | ||
name: "Nix Release builds" | ||
name: "Package libcore" | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- release/4.0.0 | ||
- release/4.1.0 | ||
- release/4.2.0 | ||
- develop | ||
push: | ||
branches: | ||
- main | ||
- release/4.0.0 | ||
- release/4.1.0 | ||
- release/4.2.0 | ||
- develop | ||
tags: | ||
- '*' | ||
workflow_run: | ||
workflows: ["Release libcore"] | ||
types: | ||
- completed | ||
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 | ||
workflow_call: | ||
inputs: | ||
release: | ||
required: false | ||
type: boolean | ||
version: | ||
required: false | ||
type: string | ||
jobs: | ||
libcore_version: | ||
name: Compute libcore version | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name != "workflow_run" || github.event.workflow_run.conclusion == 'success' }} | ||
outputs: | ||
lib_version: ${{ steps.lib_version.outputs.lib_version }} | ||
deploy_dynlibs: ${{ steps.lib_version.outputs.deploy_dynlibs }} | ||
|
@@ -38,53 +36,25 @@ jobs: | |
# 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 ${{ github.event.pull_request.head.ref }} | ||
Ubuntu_jni: | ||
name: Linux (with JNI) | ||
needs: libcore_version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/[email protected] | ||
with: | ||
submodules: 'recursive' | ||
- uses: cachix/[email protected] | ||
with: | ||
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/5f746317f10f7206f1dbb8dfcfc2257b04507eee.tar.gz | ||
- run: nix-build | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ needs.libcore_version.outputs.lib_version }}-linux-libledgercore | ||
path: result/lib/libledger-core.so | ||
retention-days: 30 | ||
MacOS_jni: | ||
name: MacOS (with JNI) | ||
needs: libcore_version | ||
runs-on: macos-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/[email protected] | ||
with: | ||
submodules: 'recursive' | ||
- uses: cachix/[email protected] | ||
with: | ||
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/5f746317f10f7206f1dbb8dfcfc2257b04507eee.tar.gz | ||
- run: nix-build | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ needs.libcore_version.outputs.lib_version }}-macos-libledgercore | ||
path: result/lib/libledger-core.dylib | ||
retention-days: 30 | ||
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' | ||
JAR: | ||
name: Jar build (MacOS + Linux) | ||
needs: [Ubuntu_jni, MacOS_jni, libcore_version] | ||
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/[email protected] | ||
|
@@ -93,23 +63,19 @@ jobs: | |
- uses: actions/[email protected] | ||
with: | ||
submodules: 'recursive' | ||
- uses: cachix/[email protected] | ||
with: | ||
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/5f746317f10f7206f1dbb8dfcfc2257b04507eee.tar.gz | ||
- run: mkdir -p jar_build/src/main/resources/resources/djinni_native_libs | ||
- name: Fetch Linux so | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: ${{ needs.libcore_version.outputs.lib_version }}-linux-libledgercore | ||
name: linux-ubuntu-22.04-libledgercore | ||
path: jar_build/src/main/resources/resources/djinni_native_libs | ||
- name: Fetch MacOS dylib | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: ${{ needs.libcore_version.outputs.lib_version }}-macos-libledgercore | ||
name: macos-libledgercore | ||
path: jar_build/src/main/resources/resources/djinni_native_libs | ||
- run: nix-shell --run "bash nix/scripts/build_jar.sh" nix/libcore-jar.nix | ||
- run: bash nix/scripts/build_jar.sh | ||
env: | ||
LIB_VERSION: ${{ needs.libcore_version.outputs.lib_version }} | ||
GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }} | ||
JAR_VERSION: ${{ needs.libcore_version.outputs.jar_version }} | ||
- uses: actions/upload-artifact@v2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,20 +3,32 @@ on: | |
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Release version" | ||
description: "Release version (tag)" | ||
required: true | ||
type: string | ||
releaseNote: | ||
description: "Should create a Release" | ||
description: "Create a Github Release note" | ||
required: true | ||
type: boolean | ||
default: true | ||
preRelease: | ||
description: "This is a pre-release" | ||
required: true | ||
type: boolean | ||
default: false | ||
draft: | ||
description: "Save Release as draft" | ||
required: true | ||
type: boolean | ||
default: false | ||
jobs: | ||
Release: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
VERSION: ${{ github.event.inputs.version }} | ||
RELEASE_NOTE: ${{ github.event.inputs.releaseNote }} | ||
PRE_RELEASE: ${{ github.event.inputs.preRelease }} | ||
DRAFT: ${{ github.event.inputs.draft }} | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set version number | ||
|
@@ -37,14 +49,42 @@ jobs: | |
script: | | ||
try { | ||
await github.rest.repos.createRelease({ | ||
draft: false, | ||
draft: process.env.DRAFT, | ||
generate_release_notes: true, | ||
name: process.env.RELEASE_TAG, | ||
owner: context.repo.owner, | ||
prerelease: false, | ||
prerelease: process.env.PRE_RELEASE, | ||
repo: context.repo.repo, | ||
tag_name: process.env.VERSION, | ||
}); | ||
} catch (error) { | ||
core.setFailed(error.message); | ||
} | ||
} | ||
Build: | ||
name: Build Release with JNI | ||
uses: ./.github/workflows/nix_release_builds.yml | ||
secrets: inherit # pass all secrets | ||
needs: [ Release ] | ||
with: | ||
release: true | ||
version: ${{ github.event.inputs.version }} | ||
Publish: | ||
name: Publish to WD | ||
needs: [Build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
name: Checkout libcore | ||
- uses: actions/checkout@v3 | ||
name: Checkout wallet-daemont | ||
with: | ||
token: ${{ secrets.CI_BOT_TOKEN }} | ||
repository: LedgerHQ/ledger-wallet-daemon | ||
submodules: true | ||
path: ledger-wallet-daemon | ||
- name: Publish to WD | ||
env: | ||
GH_TOKEN: ${{ secrets.CI_BOT_TOKEN }} | ||
VERSION: ${{ github.event.inputs.version }} | ||
run: .github/scripts/publish_to_wd.sh | ||
|
Oops, something went wrong.