Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not check out non-existent branches #29

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions .github/workflows/build-and-publish-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

env:
RUST_VERSION: 1.78
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
LDK_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
TARGET_BRANCH_PREFIX: "publish-"

jobs:
Expand Down Expand Up @@ -116,21 +116,12 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: Checkout ldk-node-go master
- name: Checkout ldk-node-go
uses: actions/checkout@v4
if: ${{ env.BRANCH_NAME == 'main' }}
with:
repository: getAlby/ldk-node-go
ssh-key: ${{ secrets.LDK_NODE_GO_DEPLOY_KEY }}

- name: Checkout ldk-node-go branch
uses: actions/checkout@v4
if: ${{ env.BRANCH_NAME != 'main' }}
with:
repository: getAlby/ldk-node-go
ssh-key: ${{ secrets.LDK_NODE_GO_DEPLOY_KEY }}
ref: '${{ env.TARGET_BRANCH_PREFIX }}${{ env.BRANCH_NAME }}'

- name: Download bindings
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -166,10 +157,18 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "github-actions"
git config --global push.autoSetupRemote true
if [ "${{ env.LDK_BRANCH_NAME }}" != "main" ]; then
git checkout -b ${{ env.TARGET_BRANCH_PREFIX }}${{ env.LDK_BRANCH_NAME }}
fi
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/arm-unknown-linux-gnueabihf/libldk_node.so
git add ldk_node/x86_64-pc-windows-gnu/ldk_node.dll
git add ldk_node/universal-macos/libldk_node.dylib
git commit -m "Update bindings."
git push

if [ "${{ env.LDK_BRANCH_NAME }}" != "main" ]; then
git push origin ${{ env.TARGET_BRANCH_PREFIX }}${{ env.LDK_BRANCH_NAME }}
else
git push origin master
fi
Loading