From 429e9024f3cca7b8fddf54bc09098fb39cb46476 Mon Sep 17 00:00:00 2001 From: Roman Dmitrienko Date: Thu, 20 Jun 2024 22:12:57 +0200 Subject: [PATCH 1/3] feat: build bindings for aarch64-unknown-linux --- .github/workflows/build-libraries.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-libraries.yaml b/.github/workflows/build-libraries.yaml index 96ca6b525..838e5852a 100644 --- a/.github/workflows/build-libraries.yaml +++ b/.github/workflows/build-libraries.yaml @@ -13,6 +13,7 @@ jobs: matrix: build: [ { host: ubuntu-20.04, tool: cargo, target: x86_64-unknown-linux-gnu, output: libldk_node.so }, + { host: ubuntu-20.04, tool: cross, target: aarch64-unknown-linux-gnu, output: libldk_node.so }, { host: ubuntu-20.04, tool: cross, target: arm-unknown-linux-gnueabihf, output: libldk_node.so }, { host: windows-2019, tool: cargo, target: x86_64-pc-windows-msvc, output: ldk_node.dll }, { host: macos-12, tool: cargo, target: x86_64-apple-darwin, output: libldk_node.dylib }, From d67a2348ea42ff97aab7706e2e2a8ab2cd59d6a0 Mon Sep 17 00:00:00 2001 From: Roman Dmitrienko Date: Thu, 20 Jun 2024 22:20:01 +0200 Subject: [PATCH 2/3] fix: publish linux aarch64 libraries --- .github/workflows/publish-bindings-go.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/publish-bindings-go.yaml b/.github/workflows/publish-bindings-go.yaml index 0e1abb9df..2a422cb92 100644 --- a/.github/workflows/publish-bindings-go.yaml +++ b/.github/workflows/publish-bindings-go.yaml @@ -42,6 +42,12 @@ jobs: name: ldk-node-x86_64-unknown-linux-gnu path: ldk_node/x86_64-unknown-linux-gnu + - name: Download Linux aarch64 libs + uses: actions/download-artifact@v4 + with: + name: ldk-node-aarch64-unknown-linux-gnu + path: ldk_node/aarch64-unknown-linux-gnu + - name: Download Linux ARM libs uses: actions/download-artifact@v4 with: @@ -68,6 +74,7 @@ jobs: git add ldk_node/ldk_node.go ldk_node/ldk_node.h ldk_node/ldk_node.c git add ldk_node/x86_64-unknown-linux-gnu/libldk_node.so + git add ldk_node/aarch64-unknown-linux-gnu/libldk_node.so git add ldk_node/arm-unknown-linux-gnueabihf/libldk_node.so git add ldk_node/x86_64-pc-windows-msvc/ldk_node.dll git add ldk_node/universal-macos/libldk_node.dylib From 9d30ea6bcc7c538c3acab6c60053ce25539b201d Mon Sep 17 00:00:00 2001 From: Roman Dmitrienko Date: Thu, 20 Jun 2024 22:47:48 +0200 Subject: [PATCH 3/3] fix: only publish on push to the main branch --- .../workflows/build-and-publish-bindings.yml | 1 + .github/workflows/publish-bindings-go.yaml | 17 +++-------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-and-publish-bindings.yml b/.github/workflows/build-and-publish-bindings.yml index 1dd0ca149..48aa86297 100644 --- a/.github/workflows/build-and-publish-bindings.yml +++ b/.github/workflows/build-and-publish-bindings.yml @@ -33,6 +33,7 @@ jobs: rust_version: ${{ needs.setup.outputs.rust_version }} publish-ldk-node-go: + if: github.ref_name == 'main' || github.head_ref == 'main' needs: - generate-bindings - build-libraries diff --git a/.github/workflows/publish-bindings-go.yaml b/.github/workflows/publish-bindings-go.yaml index 2a422cb92..1dfe6ff88 100644 --- a/.github/workflows/publish-bindings-go.yaml +++ b/.github/workflows/publish-bindings-go.yaml @@ -6,29 +6,18 @@ on: LDK_NODE_GO_DEPLOY_KEY: required: true -env: - LDK_BRANCH_NAME: ${{ github.head_ref || github.ref_name }} - TARGET_BRANCH_PREFIX: "publish-" - jobs: publish-ldk-node-go: runs-on: ubuntu-20.04 - steps: - - name: Set target branch name - run: | - if [ "${{ env.LDK_BRANCH_NAME }}" != "main" ]; then - echo "TARGET_BRANCH=${{ env.TARGET_BRANCH_PREFIX }}${{ env.LDK_BRANCH_NAME }}" >> $GITHUB_ENV - else - echo "TARGET_BRANCH=master" >> $GITHUB_ENV - fi + if: github.ref_name == 'main' || github.head_ref == 'main' + steps: - name: Checkout ldk-node-go uses: actions/checkout@v4 with: repository: getAlby/ldk-node-go ssh-key: ${{ secrets.LDK_NODE_GO_DEPLOY_KEY }} - ref: ${{ env.TARGET_BRANCH }} - name: Download bindings uses: actions/download-artifact@v4 @@ -79,4 +68,4 @@ jobs: git add ldk_node/x86_64-pc-windows-msvc/ldk_node.dll git add ldk_node/universal-macos/libldk_node.dylib git commit -m "Update bindings." - git push origin ${{ env.TARGET_BRANCH }} + git push