v0.0.6 (#4) #10
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
name: Library updater for znn_ledger_dart | |
on: | |
push: | |
branches: | |
- main | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
lib-builder: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Prepare environment | |
run: | | |
sudo apt update | |
sudo apt upgrade -y | |
sudo apt install -y unzip | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download libledger_ffi | |
uses: robinraju/release-downloader@v1 | |
with: | |
repository: "zenon-network/ledger_ffi_rs" | |
latest: true | |
fileName: '*.zip' | |
- name: Unzip libledger_ffi native library to blobs directory | |
run: | | |
unzip -j -o libledger_ffi-darwin-universal.zip -d lib/src/ledger/blobs/ | |
unzip -j -o libledger_ffi-linux-amd64.zip -d lib/src/ledger/blobs/ | |
unzip -j -o libledger_ffi-windows-amd64.zip -d lib/src/ledger/blobs/ | |
- name: Check if there are changes | |
run: | | |
function check() { | |
if [[ -z "$(git status --porcelain)" ]]; | |
then | |
echo "0" | |
else | |
echo "1" | |
fi | |
} | |
echo "CHANGED=$(check)" >> $GITHUB_ENV | |
- name: Push if changes are present | |
if: ${{ env.CHANGED == '1' }} | |
run: | | |
git config user.name "Github Actions" | |
git config user.email "GH-actions-ci@github.com" | |
git add -f lib/src/ledger/blobs/* | |
git commit -m "Updated native libraries" | |
git push |