Skip to content

fix: sgn(0) == 0

fix: sgn(0) == 0 #381

name: push-onlyswaps-verifier-docker
on:
push:
branches:
# all branches, docker image is only pushed on main
- "*"
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
pull_request:
env:
SERVICE_ACCOUNT: [email protected]
DOCKER_REGISTRY: europe-west1-docker.pkg.dev/randamu-prod/candyland
IMAGE_MAINTAINER: "Randamu"
IMAGE_VENDOR: "Randamu"
jobs:
build-and-push:
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Login to Artifact Registry
uses: docker/login-action@v3
with:
registry: europe-west1-docker.pkg.dev
username: _json_key
password: ${{ secrets.GCP_SERVICE_ACCOUNT_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_REGISTRY }}/onlyswaps-verifier
labels: |
maintainer=${{ env.IMAGE_MAINTAINER }}
org.opencontainers.image.title=onlyswaps-verifier
org.opencontainers.image.description="a rust agent for verifying crosschain swaps"
org.opencontainers.image.vendor=${{ env.IMAGE_VENDOR }}
flavor: |
latest=false
prefix=
suffix=
tags: |
type=sha,prefix=
type=ref,event=branch,suffix=-latest,enable=${{ startsWith(github.ref, 'refs/heads/') }}
type=semver,pattern={{version}},event=tag,enable=${{ startsWith(github.ref, 'refs/tags/') }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
# this might not work at all, but might work and
# allow us to bypass dockerhub ratelimit
buildkitd-config-inline: |
[registry."docker.io"]
mirrors = ["mirror.gcr.io"]
## this does work to avoid the dockerhub ratelimit
driver-opts: |
image=mirror.gcr.io/moby/buildkit:buildx-stable-1
network=host
- name : Add SHORT_SHA Environment Variable
id : short-sha
shell: bash
run : echo "SHORT_SHA=`git rev-parse --short HEAD`" >> $GITHUB_ENV
- id: docker-push-tagged
name: Tag Docker image and push to Google Artifact Registry
uses: docker/build-push-action@v6
with:
push: ${{ github.ref == 'refs/heads/main' }}
tags: |
${{ steps.meta.outputs.tags }}
ghcr.io/randa-mu/dcipher/onlyswaps-verifier:main-latest
ghcr.io/randa-mu/dcipher/onlyswaps-verifier:${{ env.SHORT_SHA }}
labels: ${{ steps.meta.outputs.labels }}
context: .
file: ./onlyswaps-verifier/Dockerfile
cache-from: |
type=registry,ref=${{ env.DOCKER_REGISTRY }}/onlyswaps-verifier-cache:${{ steps.meta.outputs.version }}
type=registry,ref=${{ env.DOCKER_REGISTRY }}/onlyswaps-verifier-cache:main-latest
cache-to: type=registry,ref=${{ env.DOCKER_REGISTRY }}/onlyswaps-verifier-cache:${{ steps.meta.outputs.version }},mode=max
- name : extract binary
if: ${{startsWith(github.ref, 'refs/tags/') }}
shell: bash
run : |
docker pull ghcr.io/randa-mu/dcipher/onlyswaps-verifier:${{ env.SHORT_SHA }}
container=$(docker create ghcr.io/randa-mu/dcipher/onlyswaps-verifier:${{ env.SHORT_SHA }})
docker cp $container:usr/local/bin/onlyswaps-verifier /tmp/onlyswaps-verifier
docker rm $container
- name: upload binary to release
if: ${{startsWith(github.ref, 'refs/tags/') }}
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create ${{ github.ref_name }} --generate-notes || true
gh release upload ${{ github.ref_name }} /tmp/onlyswaps-verifier