Skip to content

Commit

Permalink
ci: PR branch include ibc version
Browse files Browse the repository at this point in the history
  • Loading branch information
manhinhang committed Apr 17, 2024
1 parent b57d02f commit d5e46fd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
File renamed without changes.
13 changes: 11 additions & 2 deletions .github/workflows/detect-new-ver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,25 @@ jobs:
IB_GATEWAY_VER=$(python scripts/detect_ib_gateway_ver.py)
echo ib-gateway-ver=${IB_GATEWAY_VER} >> "$GITHUB_OUTPUT"
python scripts/detect_ibc_ver.py
source .env
echo ibc-ver=${IBC_VER} >> "$GITHUB_OUTPUT"
echo ibc-asset-url=${IBC_ASSET_URL} >> "$GITHUB_OUTPUT"
source default.env
if [ "$IB_GATEWAY_VER" = "$CUR_IB_GATEWAY_VER" ]; then
echo "No dated IB gateway version"
echo has_update=false >> "$GITHUB_OUTPUT"
else
echo "New IB gateway version($IB_GATEWAY_VER)"
echo has_update=true >> "$GITHUB_OUTPUT"
fi
if [ "$IBC_VER" = "$CUR_IBC_VER" ]; then
echo "No dated IBC version"
echo has_update=false >> "$GITHUB_OUTPUT"
else
echo "New IBC version($IBC_VER)"
echo has_update=true >> "$GITHUB_OUTPUT"
fi
- name: Update files with new version
if: steps.check-update.outputs.has_update == 'true'
run: |
Expand All @@ -41,7 +50,7 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
branch='feat/update-to-${{ steps.check-update.outputs.ib-gateway-ver }}'
branch='feat/update-to-${{ steps.check-update.outputs.ib-gateway-ver }}-ibc${{steps.check-update.outputs.ibc-ver}}'
git config user.name github-actions
git config user.email [email protected]
git pull
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
*.pyc
.secrets
.env
.vscode
8 changes: 4 additions & 4 deletions scripts/detect_ibc_ver.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
for asset in latest["assets"]:
if asset["name"].startswith("IBCLinux"):
asset_url = asset["browser_download_url"]
os.putenv("IBC_VER", ver)
os.putenv("IBC_ASSET_URL", asset_url)
print(ver)
print(asset_url)

with open('.env', 'a') as fp:
fp.write(f'IBC_VER={ver}\n')
fp.write(f'IBC_ASSET_URL={asset_url}\n')

0 comments on commit d5e46fd

Please sign in to comment.