Bridge #32
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: Bridge | |
on: | |
workflow_run: | |
workflows: ["Release Tag"] | |
types: [completed] | |
workflow_dispatch: | |
inputs: | |
force: | |
description: 'Force execution of this action' | |
type: boolean | |
required: false | |
default: true | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
Bridge: | |
runs-on: ubuntu-latest | |
environment: tags | |
if: ${{ github.event.workflow_run.conclusion == 'success' || inputs.force }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Protobuf | |
run: | | |
sudo apt install -y protobuf-compiler | |
protoc --version | |
- name: Build witnet-centralized-ethereum-bridge | |
run: | | |
cargo build -p witnet-centralized-ethereum-bridge --release | |
- name: Move file to outside docker ignored | |
run: | | |
cp target/release/witnet-centralized-ethereum-bridge ./ | |
- name: Check Pre-release | |
run: | | |
TAG=${{ github.ref_name }} | |
if [[ "$TAG" =~ - ]]; then | |
echo "prerelease=true" >> $GITHUB_ENV | |
else | |
echo "prerelease=false" >> $GITHUB_ENV | |
fi | |
- name: Set Version | |
run: | | |
echo VERNUM=$(sed -nE 's/version\s?=\s?"([0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9\.]+)?)"/\1/p' ./bridges/centralized-ethereum/Cargo.toml | head -1) >> $GITHUB_ENV | |
- name: Login to Docker hub Registry | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build & Push Tag Image | |
run: | | |
docker build -t witnet/witnet-centralized-ethereum-bridge:"$VERNUM" -f ./docker/bridge/Dockerfile . | |
docker push witnet/witnet-centralized-ethereum-bridge:"$VERNUM" | |
- name: Build & Push Latest if not Pre-Release | |
run: | | |
docker build -t witnet/witnet-centralized-ethereum-bridge:latest -f ./docker/bridge/Dockerfile . | |
docker push witnet/witnet-centralized-ethereum-bridge:latest | |
if: env.prerelease == 'false' | |
Failure: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | |
steps: | |
- run: echo '(Release Tag) workflow failed, EXITING!!!!' && exit 1 |