Skip to content

fix decoderRegistryScriptTest #171

fix decoderRegistryScriptTest

fix decoderRegistryScriptTest #171

Workflow file for this run

name: Push release to private registry
on:
push:
# This runs the job when new tag is pushed OR a commit/PR is pushed to master
tags:
- "*"
branches:
- master
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repo and submodules
uses: actions/checkout@v3
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install deps
run: forge install
- name: Run tests
run: forge test -vvv
version-tag-match:
runs-on: ubuntu-latest
steps:
- name: Checkout repo and submodules
uses: actions/checkout@v3
- name: Parse cargo.toml and assert version tag matching
# Hacky way of parsing the version from Cargo.toml and comparing it to tag
run: |
if [ "$(cat bindings/rust/Cargo.toml | grep version | head -n 1 |awk '{print $3}' | tr -d '"' )" == "${GITHUB_REF#refs/*/}" ];then exit 0; else exit 1; fi
publish:
needs: [test, version-tag-match]
# Ensure master is tagged
if: github.event.base_ref == 'refs/heads/master'
name: Build & Deploy to registry
env:
CARGO_REGISTRY_DEFAULT: fulmin-labs-registry
CARGO_REGISTRIES_FULMIN_LABS_REGISTRY_INDEX: ${{ secrets.CARGO_REGISTRY_INDEX_URL }}
CARGO_REGISTRIES_FULMIN_LABS_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: Checkout repo and submodules
uses: actions/checkout@v3
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install deps
run: forge install
- name: Extract Git Tag
run: echo "GIT_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Build contract artifacts
run: forge build
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install twine & build
run: pip3 install twine build
- name: Move contract artifacts to python folder
working-directory: python
run: python3 copy_abis.py
- name: Build flood_contracts_abi package
working-directory: python
run: python3 -m build
- name: Publish to pypi
working-directory: python
run: python3 -m twine upload -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} dist/* --repository-url ${{ secrets.PYPI_REPOSITORY_URL }}
- name: Publish to cargo
working-directory: bindings/rust
run: cargo publish --registry fulmin-labs-registry