Skip to content

Update networks.py

Update networks.py #50

Workflow file for this run

name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: ${{ matrix.OS }}
strategy:
matrix:
include:
- OS: ubuntu-latest
PYTHON_VERSION: 3.8.12
BUILD_CMD: |
export PYTHONHASHSEED=42
export BUILD_FILE_NAME=stakewise-cli-${RELEASE_VERSION}-linux-amd64;
mkdir ${BUILD_FILE_NAME};
poetry run pyinstaller --onefile --hidden-import multiaddr.codecs.uint16be --hidden-import multiaddr.codecs.idna --collect-data stakewise_cli ./stakewise_cli/main.py --name stakewise-cli --distpath ./${BUILD_FILE_NAME};
tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME};
mkdir /tmp/artifacts;
cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts;
sha256sum ${BUILD_FILE_NAME}.tar.gz | head -c 64 > /tmp/artifacts/${BUILD_FILE_NAME}.sha256;
- OS: macos-11
PYTHON_VERSION: 3.8.12
BUILD_CMD: |
export PYTHONHASHSEED=42
export BUILD_FILE_NAME=stakewise-cli-${RELEASE_VERSION}-darwin-amd64;
mkdir ${BUILD_FILE_NAME};
poetry run pyinstaller --onefile --hidden-import multiaddr.codecs.uint16be --hidden-import multiaddr.codecs.idna --collect-data stakewise_cli ./stakewise_cli/main.py --name stakewise-cli --distpath ./${BUILD_FILE_NAME};
tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME};
mkdir /tmp/artifacts;
cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts;
shasum -a 256 ${BUILD_FILE_NAME}.tar.gz | head -c 64 > /tmp/artifacts/${BUILD_FILE_NAME}.sha256
- OS: windows-latest
PYTHON_VERSION: 3.8.10
BUILD_CMD: |
$RELEASE_VERSION = $env:GITHUB_REF.replace('refs/tags/', '')
$BUILD_FILE_NAME = "stakewise-cli-" + $RELEASE_VERSION + "-windows-amd64"
$BUILD_FILE_NAME_PATH = ".\" + $BUILD_FILE_NAME
poetry run pyinstaller --onefile --hidden-import multiaddr.codecs.uint16be --hidden-import multiaddr.codecs.idna --collect-data stakewise_cli ./stakewise_cli/main.py --name stakewise-cli --distpath $BUILD_FILE_NAME_PATH
$ZIP_FILE_NAME = $BUILD_FILE_NAME + ".zip"
Compress-Archive -Path $BUILD_FILE_NAME_PATH -DestinationPath $ZIP_FILE_NAME
mkdir \tmp\artifacts
copy $ZIP_FILE_NAME \tmp\artifacts\
$CHECKSUM_FILE_NAME_PASH = "\tmp\artifacts\" + $BUILD_FILE_NAME + ".sha256"
certUtil -hashfile $ZIP_FILE_NAME SHA256 | findstr /i /v "SHA256" | findstr /i /v "CertUtil" > $CHECKSUM_FILE_NAME_PASH
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Install Poetry
uses: snok/install-poetry@v1.3.1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Build executable for ${{ matrix.OS }}
env:
RELEASE_VERSION: ${{ steps.get_version.outputs.VERSION }}
run: ${{ matrix.BUILD_CMD }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.OS }}
path: /tmp/artifacts/*
if-no-files-found: error
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v2
with:
path: /tmp/artifacts
- name: Display structure of downloaded files
run: ls -R
working-directory: /tmp/artifacts
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Release
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: true
files: |
/tmp/artifacts/ubuntu-latest/stakewise-cli-${{ steps.get_version.outputs.VERSION }}-linux-amd64.tar.gz
/tmp/artifacts/ubuntu-latest/stakewise-cli-${{ steps.get_version.outputs.VERSION }}-linux-amd64.sha256
/tmp/artifacts/macos-11/stakewise-cli-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.tar.gz
/tmp/artifacts/macos-11/stakewise-cli-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.sha256
/tmp/artifacts/windows-latest/stakewise-cli-${{ steps.get_version.outputs.VERSION }}-windows-amd64.zip
/tmp/artifacts/windows-latest/stakewise-cli-${{ steps.get_version.outputs.VERSION }}-windows-amd64.sha256