Skip to content

Commit

Permalink
chore(infra): upload the binary from docker image with sha256sum to r… (
Browse files Browse the repository at this point in the history
#168)

* chore(infra): upload the binary from docker image with sha256sum to releases

* chore(infra): upload the binaries to s3
  • Loading branch information
talalashraf authored Aug 26, 2021
1 parent 86b96d2 commit 4c4f2e8
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ jobs:
run: |
make docker-image
- name: Copy binary from docker image
env:
SEMVER: ${{ steps.release.outputs.new_tag }}
run: |
make copy-binary-from-image
- name: Login to DockerHub
uses: docker/login-action@v1
with:
Expand All @@ -101,3 +107,25 @@ jobs:
run: |
docker tag axelar/tofnd:latest axelarnet/tofnd:${{ steps.release.outputs.new_tag }}
docker push axelarnet/tofnd:${{ steps.release.outputs.new_tag }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./bin/*
tag: ${{ steps.release.outputs.new_tag }}
overwrite: true
file_glob: true

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2

- name: Upload binaries to S3
env:
S3_PATH: s3://axelar-releases/tofnd/${{ steps.release.outputs.new_tag }}
run: |
make upload-binaries-to-s3
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
/.vscode
/.vscode
bin/tofnd*
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ docker-image: git-submodule-setup
docker-image-malicious: git-submodule-setup
@DOCKER_BUILDKIT=1 docker build --ssh default --build-arg features="malicious" -t axelar/tofnd-malicious .


.PHONY: copy-binary
copy-binary-from-image: guard-SEMVER
./scripts/copy-binaries-from-image.sh
mv bin/tofnd bin/tofnd-linux-arm64-${SEMVER}
cd bin && sha256sum * > SHA256SUMS

.PHONY: upload-binaries-to-s3
upload-binaries-to-s3: guard-S3_PATH
aws s3 cp ./bin ${S3_PATH}/ --recursive

.PHONY: docker-image-all
docker-image-all: git-submodule-setup
make docker-image
Expand All @@ -15,3 +26,6 @@ docker-image-all: git-submodule-setup
git-submodule-setup:
git submodule init
git submodule update

guard-%:
@ if [ -z '${${*}}' ]; then echo 'Environment variable $* not set' && exit 1; fi
Empty file added bin/.gitkeep
Empty file.
5 changes: 5 additions & 0 deletions scripts/copy-binaries-from-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

container_id=$(docker create axelar/tofnd:latest)
docker cp "$container_id":/usr/local/bin/tofnd ./bin/
docker rm -v "$container_id"

0 comments on commit 4c4f2e8

Please sign in to comment.