Skip to content

fix finalization

fix finalization #813

Workflow file for this run

name: Deploy
on: push
jobs:
testnet:
env:
BRANCH: ${{ github.ref_name }}
NETWORK: testnet
NODE: ${{ secrets.TESTNETNODE }}
MONGOURI: ${{ secrets.TESTNETMONGOURI }}
MONGODATABASENAME: ${{ secrets.TESTNETMONGODATABASENAME }}
MONGOCOLLECTIONCONTRACTS: ${{ secrets.TESTNETMONGOCOLLECTIONCONTRACTS }}
MONGOCOLLECTIONBRANCHES: ${{ secrets.TESTNETMONGOCOLLECTIONBRANCHES }}
COMPARELPSCRIPTADDRESS: 3N6wAa7PMFZJu4Zrmp3avXmMnRTrRpMM9Lh # WX/USDN pool
COMPARELPSTABLESCRIPTADDRESS: 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT # USDT/USDN pool
FEESEED: ${{ secrets.TESTNETFEESEED }}
# For Docs
TESTNETNODE: ${{ secrets.TESTNETNODE }}
MAINNETNODE: ${{ secrets.MAINNETNODE }}
TESTNETMONGOURI: ${{ secrets.TESTNETMONGOURI }}
MAINNETMONGOURI: ${{ secrets.MAINNETMONGOURI }}
runs-on: self-hosted
permissions:
contents: write
container:
image: golang:1.19
options: --user 0
steps:
- name: Clean step
uses: mickem/clean-after-action@v1
if: always()
with:
keepGit: true
- name: Check out the repo
uses: actions/checkout@v2
- name: Merge 'main' to '${{ github.ref_name }}' branch
uses: devmasx/merge-branch@master
with:
type: now
from_branch: main
target_branch: ${{ github.ref_name }}
message: Auto-merge 'main' -> '${{ github.ref_name }}'
github_token: ${{ github.token }}
- name: Deploy changed contracts to testnet and update docs
run: |
cd deployer
go run cmd/github-actions-ci/main.go
- name: Commit docs to '_docs' branch
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: _docs
FOLDER: docs
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MESSAGE: Update docs from '${{ github.ref_name }}' branch
- name: Clean repo
uses: AutoModality/action-clean@v1
if: always()
mainnet:
env:
BRANCH: ${{ github.ref_name }}
NETWORK: mainnet
NODE: ${{ secrets.MAINNETNODE }}
MONGOURI: ${{ secrets.MAINNETMONGOURI }}
MONGODATABASENAME: ${{ secrets.MAINNETMONGODATABASENAME }}
MONGOCOLLECTIONCONTRACTS: ${{ secrets.MAINNETMONGOCOLLECTIONCONTRACTS }}
MONGOCOLLECTIONBRANCHES: ${{ secrets.MAINNETMONGOCOLLECTIONBRANCHES }}
COMPARELPSCRIPTADDRESS: 3PCENpEKe8atwELZ7oCSmcdEfcRuKTrUx99 # WX/USDN pool
COMPARELPSTABLESCRIPTADDRESS: 3P8KMyAJCPWNcyedqrmymxaeWonvmkhGauz # USDT/USDN pool
FEESEED: ${{ secrets.MAINNETFEESEED }}
# For Docs
TESTNETNODE: ${{ secrets.TESTNETNODE }}
MAINNETNODE: ${{ secrets.MAINNETNODE }}
TESTNETMONGOURI: ${{ secrets.TESTNETMONGOURI }}
MAINNETMONGOURI: ${{ secrets.MAINNETMONGOURI }}
if: github.ref_name == 'main'
runs-on: self-hosted
container:
image: golang:1.19
options: --user 0
steps:
- name: Clean repo
uses: AutoModality/action-clean@v1
if: always()
- name: Clean step
uses: mickem/clean-after-action@v1
if: always()
with:
keepGit: true
- name: Check out the repo
uses: actions/checkout@v2
- name: Compare contracts and print diff. Deploy changed pools
run: |
cd deployer
go run cmd/github-actions-ci/main.go
- name: Save txs to sign in artifact folder
uses: actions/upload-artifact@v3
with:
name: txs
path: .github/artifacts/txs