Skip to content

Commit

Permalink
fix: pass branch name to the checkout action
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmitr committed Jun 16, 2024
1 parent 0e70a79 commit 21bfc30
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/publish-bindings-go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,20 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: Set target branch name
run: |
if [ "${{ env.GLALBY_BRANCH_NAME }}" != "master" ]; then
echo "TARGET_BRANCH=${{ env.TARGET_BRANCH_PREFIX }}${{ env.GLALBY_BRANCH_NAME }}" >> $GITHUB_ENV
else
echo "TARGET_BRANCH=main" >> $GITHUB_ENV
fi
- name: Checkout glalby-go
uses: actions/checkout@v4
with:
repository: getAlby/glalby-go
ssh-key: ${{ secrets.GLALBY_GO_DEPLOY_KEY }}

- name: Prepare git
run: |
git config --global user.email "github-actions@github.com"
git config --global user.name "github-actions"
git config --global push.autoSetupRemote true
if [ "${{ env.GLALBY_BRANCH_NAME }}" != "main" ]; then
git checkout -b ${{ env.TARGET_BRANCH_PREFIX }}${{ env.GLALBY_BRANCH_NAME }}
git pull origin ${{ env.TARGET_BRANCH_PREFIX }}${{ env.GLALBY_BRANCH_NAME }} || true
fi
ref: ${{ env.TARGET_BRANCH }}

- name: Download bindings
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -63,15 +62,14 @@ jobs:

- name: Commit and push bindings
run: |
git config --global user.email "github-actions@github.com"
git config --global user.name "github-actions"
git config --global push.autoSetupRemote true
git add glalby/glalby.go glalby/glalby.h glalby/glalby.c
git add glalby/x86_64-unknown-linux-gnu/libglalby_bindings.so
git add glalby/arm-unknown-linux-gnueabihf/libglalby_bindings.so
git add glalby/x86_64-pc-windows-msvc/glalby_bindings.dll
git add glalby/universal-macos/libglalby_bindings.dylib
git commit -m "Update bindings."
if [ "${{ env.GLALBY_BRANCH_NAME }}" != "main" ]; then
git push origin ${{ env.TARGET_BRANCH_PREFIX }}${{ env.GLALBY_BRANCH_NAME }}
else
git push origin master
fi
git push origin ${{ env.TARGET_BRANCH }}

0 comments on commit 21bfc30

Please sign in to comment.