Skip to content

Commit

Permalink
Merge pull request #376 from skalenetwork/merge-beta
Browse files Browse the repository at this point in the history
1.3.3 (add checksum to release)
  • Loading branch information
badrogger authored Apr 4, 2023
2 parents 4c62e9d + 820aec2 commit 3d3edf3
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 17 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/issue_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Get linked issues
on:
pull_request:
types: [ edited, synchronize, opened, reopened ]

jobs:
check-linked-issues:
name: Check if pull request has linked issues
runs-on: ubuntu-latest
steps:
- name: Get issues
id: get-issues
uses: mondeja/pr-linked-issues-action@v2
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: PR has not linked issues
if: join(steps.get-issues.outputs.issues) == ''
run:
exit 1
73 changes: 62 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
create_release:
if: github.event.pull_request.merged
name: Create release
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
version: ${{ steps.export_outputs.outputs.version }}
Expand Down Expand Up @@ -47,40 +47,79 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-22.04
- os: ubuntu-20.04
asset_name: sk-val-${{ needs.create_release.outputs.version }}-Linux-x86_64
# - os: macos-latest
# asset_name: sk-val-${{ needs.create_release.outputs.version }}-Darwin-x86_64
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.9
- name: Install ubuntu dependencies
if: matrix.os == 'ubuntu-22.04'
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install libssl3
sudo apt-get install libssl-dev
sudo apt-get install libudev-dev
sudo apt-get install libusb-1.0-0-dev
- name: Install macOS dependencies
if: matrix.os == 'macos-latest'
run: |
bash ./scripts/m2crypto_macos_fix.sh
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -e .[dev]
pip install wheel
- name: Checkout submodules
run: git submodule update --init
- name: Build library

- name: Build binary linux
if: matrix.os == 'ubuntu-20.04'
run: |
mkdir dist
docker build . -t builder
docker run -v /home/ubuntu/dist:/app/dist builder scripts/build.sh ${{ needs.create_release.outputs.version }} ${{ needs.create_release.outputs.branch }}
ls -altr /home/ubuntu/dist/
docker rm -f $(docker ps -aq)
sudo sha512sum /home/ubuntu/dist/${{ matrix.asset_name }} | sudo tee > /dev/null /home/ubuntu/dist/sha512sum
- name: Build binary mac
if: matrix.os == 'macos-latest'
run: |
bash ./scripts/build.sh ${{ needs.create_release.outputs.version }} ${{ needs.create_release.outputs.branch }}
- name: Upload Release Asset
id: upload-release-asset
sudo shasum -a 512 ./dist/${{ matrix.asset_name }} | sudo tee > /dev/null ./dist/sha512sum
- name: Upload Release Asset Ubuntu
if: matrix.os == 'ubuntu-20.04'
id: upload-release-asset-ubuntu
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: /home/ubuntu/dist/${{ matrix.asset_name }}
asset_name: ${{ matrix.asset_name }}
asset_content_type: application/octet-stream

- name: Upload release checksum
if: matrix.os == 'ubuntu-20.04'
id: upload-release-checksum-ubuntu
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: /home/ubuntu/dist/sha512sum
asset_name: ${{ matrix.asset_name }}.sha512
asset_content_type: text/plain

- name: Upload Release Asset Mac
if: matrix.os == 'macos-latest'
id: upload-release-asset-mac
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -89,3 +128,15 @@ jobs:
asset_path: ./dist/${{ matrix.asset_name }}
asset_name: ${{ matrix.asset_name }}
asset_content_type: application/octet-stream

- name: Upload release checksum
if: matrix.os == 'macos-latest'
id: upload-release-checksum-mac
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./dist/sha512sum
asset_name: ${{ matrix.asset_name }}.sha512
asset_content_type: text/plain
21 changes: 15 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Test

jobs:
test:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.8]
python-version: [3.9]
env:
ETH_PRIVATE_KEY: ${{ secrets.ETH_PRIVATE_KEY }}
ENDPOINT: ${{ secrets.ENDPOINT }}
Expand All @@ -24,7 +24,7 @@ jobs:
- name: Install ubuntu dependencies
run: |
sudo apt-get update
sudo apt-get install libssl3
sudo apt-get install libssl-dev
sudo apt-get install python-setuptools
sudo apt-get install libudev-dev
sudo apt-get install libusb-1.0-0-dev
Expand All @@ -33,13 +33,22 @@ jobs:
python -m pip install --upgrade pip
pip install -e .
pip install -e .[dev]
pip install --upgrade 'setuptools<45.0.0'
pip install --upgrade 'setuptools==63.2.0'
- name: Lint with flake8
run: |
flake8 .
- name: Build binary
- name: Build binary in 20.04 environment
run: |
bash scripts/build.sh 0.0.0 test-branch
mkdir dist
docker build . -t builder
docker run -v /home/ubuntu/dist:/app/dist builder scripts/build.sh test test
ls -altr /home/ubuntu/dist/
docker rm -f $(docker ps -aq)
- name: Build binary in Ubuntu lastest environment
run: |
scripts/build.sh test test
- name: Deploy manager contracts
run: |
bash ./helper-scripts/deploy_test_manager.sh
Expand Down
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update --fix-missing && apt-get install -y software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get install -y \
git \
python3.9 \
libpython3.9-dev \
python3.9-venv \
python3.9-distutils \
python3.9-dev \
build-essential \
zlib1g-dev \
libssl-dev \
libffi-dev \
swig

RUN mkdir /app
WORKDIR /app

COPY . .

ENV PATH=/app/buildvenv/bin:$PATH
RUN python3.9 -m venv /app/buildvenv && \
pip install --upgrade pip && \
pip install wheel setuptools==63.2.0 && \
pip install -e '.[dev]'

0 comments on commit 3d3edf3

Please sign in to comment.