Skip to content

Commit

Permalink
Merge pull request #16 from alienc0der/release-v0.0.6
Browse files Browse the repository at this point in the history
Release v0.0.6
  • Loading branch information
zenon-network authored Apr 13, 2023
2 parents 9a394eb + f40a4a2 commit c996cc4
Show file tree
Hide file tree
Showing 332 changed files with 5,668 additions and 4,753 deletions.
171 changes: 171 additions & 0 deletions .github/workflows/syrius_builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
name: Build and release syrius

on:
push:
branches-ignore:
- master
pull_request:
branches:
- dev
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build-macos:
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup environment
run: |
brew install unzip create-dmg
brew cleanup
- name: Checkout
uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Check flutter version
run: flutter --version
- name: Build syrius desktop
run: |
flutter config --enable-macos-desktop
flutter build macos --release
- name: Package into DMG
run: |
create-dmg --volname syrius \
--volicon macos/dmg/volume.icns \
--icon "s\ y\ r\ i\ u\ s.app" 210 175 \
--icon-size 90 \
--app-drop-link 390 175 \
--text-size 14 \
--background macos/dmg/background.png \
--window-pos 300 200 \
--window-size 600 325 \
--hide-extension "s\ y\ r\ i\ u\ s.app" \
--format ULFO \
--hdiutil-verbose syrius-alphanet-macos-universal.dmg build/macos/Build/Products/Release/s\ y\ r\ i\ u\ s.app \
syrius-alphanet-macos-universal.dmg build/macos/Build/Products/Release/s\ y\ r\ i\ u\ s.app
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: macos-artifacts
path: syrius-alphanet-macos-universal.dmg
build-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Check flutter version
run: flutter --version
- name: Build syrius desktop
run: |
flutter config --enable-windows-desktop
flutter build windows --release
- name: Package into zip
run: |
Compress-Archive -Path build\windows\runner\Release\* -DestinationPath .\syrius-alphanet-windows-amd64.zip
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: windows-artifacts
path: syrius-alphanet-windows-amd64.zip
build-linux:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare environment
run: |
sudo apt update
sudo apt install -y curl clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev unzip xz-utils zip libnotify-dev libayatana-appindicator3-dev
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Check flutter version
run: flutter --version
- name: Build syrius desktop
run: |
flutter config --enable-linux-desktop
flutter build linux --release
- name: Package zip
run: |
cd build/linux/x64/release/bundle
zip -r ../../../../../syrius-alphanet-linux-amd64.zip *
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: linux-artifacts
path: syrius-alphanet-linux-amd64.zip
make-release:
needs: [build-macos, build-windows, build-linux]
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set variables
run: |
SYRIUS="v$(cat pubspec.yaml | grep version | sed 's/version://' | xargs)"
echo "Syrius Version: $SYRIUS"
echo "SYRIUS_VERSION=$SYRIUS" >> $GITHUB_ENV
GOZENON=$(curl -s https://raw.githubusercontent.com/zenon-network/go-zenon/master/metadata/version.go | grep Version | awk -F '"' '{print $2}')
echo "Go-Zenon Version: $GOZENON"
BODY=$(cat <<EOF
Syrius $SYRIUS features the pre-release version of the [go-zenon](https://github.com/zenon-network/go-zenon) $GOZENON full node.
Syrius for Windows requires Microsoft Visual C++ to be installed.
[Download Microsoft Visual C++](https://aka.ms/vs/16/release/vc_redist.x64.exe)
Github Action Context information
Git reference: ${{ github.ref }}
Repository URL: ${{ github.repositoryUrl }}
Run ID: ${{ github.run_id }}
Commit hash: ${{ github.sha }}
Workflow hash: ${{ github.workflow_sha }}
EOF
)
echo "$BODY"
echo "BODY<<EOFMARKER" >> ${GITHUB_ENV}
echo "${BODY}" >> ${GITHUB_ENV}
echo "EOFMARKER" >> ${GITHUB_ENV}
- name: Prepare releases directory
run: mkdir releases
- name: Download macOS artifacts
uses: actions/download-artifact@v3
with:
name: macos-artifacts
- name: Download Windows artifacts
uses: actions/download-artifact@v3
with:
name: windows-artifacts
- name: Download Linux artifacts
uses: actions/download-artifact@v3
with:
name: linux-artifacts
- name: Prepare releases
run: |
cp syrius-alphanet-windows-amd64.zip releases/
cp syrius-alphanet-macos-universal.dmg releases/
cp syrius-alphanet-linux-amd64.zip releases/
- name: Generate checksums
run: |
cd releases/
echo $(sha256sum *)
echo $(sha256sum *) >> SHA256CHECKSUMS.txt
- name: Upload files to a GitHub release
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: releases/*
release_name: ${{ env.SYRIUS_VERSION }}
tag: ${{ env.SYRIUS_VERSION }}-alphanet
file_glob: true
overwrite: true
body: ${{ env.BODY }}
63 changes: 63 additions & 0 deletions .github/workflows/syrius_lib_updater.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Library updater for syrius

on:
push:
branches-ignore:
- master
pull_request:
branches:
- dev
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
lib-builder:
runs-on: ubuntu-latest
steps:
- name: Prepare environment
run: |
sudo apt update
sudo apt install -y unzip
- name: Checkout
uses: actions/checkout@v3
- name: Download libznn
uses: robinraju/[email protected]
with:
repository: "zenon-network/go-zenon"
latest: true
- name: Extract libznn library
run: |
tar -xvf libznn-linux-amd64.tar.gz
tar -xvf libznn-darwin-universal.tar.gz
unzip -j libznn-windows-amd64.zip -d ./
- name: Check if changes are present
run: |
LIBZNN_LINUX_AMD64=$(sha256sum ./libznn-linux-amd64.so | head -c 64)
LIBZNN_LINUX_AMD64_LOCAL=$(sha256sum ./lib/embedded_node/blobs/libznn.so | head -c 64)
LIBZNN_WINDOWS_AMD64=$(sha256sum ./libznn-windows-amd64.dll | head -c 64)
LIBZNN_WINDOWS_AMD64_LOCAL=$(sha256sum ./lib/embedded_node/blobs/libznn.dll | head -c 64)
LIBZNN_DARWIN_UNIVERSAL=$(sha256sum ./libznn-darwin-universal.dylib | head -c 64)
LIBZNN_DARWIN_UNIVERSAL_LOCAL=$(sha256sum ./lib/embedded_node/blobs/libznn.dylib | head -c 64)
function check() {
if [[ "$LIBZNN_LINUX_AMD64" == "$LIBZNN_LINUX_AMD64_LOCAL" && "$LIBZNN_WINDOWS_AMD64" == "$LIBZNN_WINDOWS_AMD64_LOCAL" && "$LIBZNN_DARWIN_UNIVERSAL" == "$LIBZNN_DARWIN_UNIVERSAL_LOCAL" ]];
then
echo "0"
else
echo "1"
fi
}
echo "CHANGED=$(check)" >> $GITHUB_ENV
- name: Move libznn native library to blobs directory
if: ${{ env.CHANGED == '1' }}
run: |
mv libznn-linux-amd64.so lib/embedded_node/blobs/libznn.so
mv libznn-darwin-universal.dylib lib/embedded_node/blobs/libznn.dylib
mv libznn-windows-amd64.dll lib/embedded_node/blobs/libznn.dll
- name: Push if changes are present
if: ${{ env.CHANGED == '1' }}
run: |
git config user.name "Github Actions"
git config user.email "[email protected]"
git add -f lib/embedded_node/blobs/*
git commit -m "Updated native libraries"
git push origin ${GITHUB_REF##*/}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,5 @@ app.*.map.json
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
!/dev/ci/**/Gemfile.lock
!/dev/ci/**/Gemfile.lock
!pubspec.lock
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021 The Zenon developers
Copyright (c) 2023 The Zenon developers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# s y r i u s

[![Build and release syrius](https://github.com/zenon-network/syrius/actions/workflows/syrius_builder.yml/badge.svg?branch=cicd)](https://github.com/zenon-network/syrius/actions/workflows/syrius_builder.yml) [![Library updater for syrius](https://github.com/zenon-network/syrius/actions/workflows/syrius_lib_updater.yml/badge.svg?branch=cicd)](https://github.com/zenon-network/syrius/actions/workflows/syrius_lib_updater.yml)

Cross-platform non-custodial wallet designed for Alphanet - Network of Momentum Phase 0.

Developed in Flutter using the [Zenon Dart SDK](https://github.com/zenon-network/znn_sdk_dart), `s y r i u s` wallet provides a simple and intuitive interface to interact with Network of Momentum Phase 0.
Expand Down Expand Up @@ -29,6 +31,8 @@ Currently supported `<os>`: `windows`, `macos`, `linux`
git clone https://github.com/zenon-network/syrius.git
flutter pub get
flutter build <os>
flutter build <os> --release
flutter run --release
```

## Contributing
Expand Down
17 changes: 14 additions & 3 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,19 @@ linter:
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

avoid_print: true # Uncomment to disable the `avoid_print` rule
prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
cancel_subscriptions: true
close_sinks: true
comment_references: true
one_member_abstracts: true
always_use_package_imports: true
avoid_empty_else: true
avoid_slow_async_io: true
avoid_web_libraries_in_flutter: true
control_flow_in_finally: true
empty_statements: true
depend_on_referenced_packages: true
secure_pubspec_urls: true
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
Binary file added assets/images/tray_app_icon.ico
Binary file not shown.
Binary file added assets/images/tray_app_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions lib/blocs/accelerator/accelerator.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
library accelerator;

export 'accelerator_balance_bloc.dart';
export 'create_phase_bloc.dart';
export 'create_project_bloc.dart';
export 'project_list_bloc.dart';
export 'project_vote_breakdown_bloc.dart';
export 'refresh_project_bloc.dart';
export 'submit_donation_bloc.dart';
export 'update_phase_bloc.dart';
export 'vote_project_bloc.dart';
6 changes: 3 additions & 3 deletions lib/blocs/accelerator/accelerator_balance_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:async';

import 'package:zenon_syrius_wallet_flutter/blocs/base_bloc.dart';
import 'package:zenon_syrius_wallet_flutter/blocs/blocs.dart';
import 'package:zenon_syrius_wallet_flutter/main.dart';
import 'package:znn_sdk_dart/znn_sdk_dart.dart';

Expand All @@ -16,8 +16,8 @@ class AcceleratorBalanceBloc extends BaseBloc<AccountInfo?> {
} else {
throw 'Accelerator fund empty';
}
} catch (e) {
addError(e);
} catch (e, stackTrace) {
addError(e, stackTrace);
}
}
}
12 changes: 6 additions & 6 deletions lib/blocs/accelerator/create_phase_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import 'package:zenon_syrius_wallet_flutter/blocs/base_bloc.dart';
import 'package:zenon_syrius_wallet_flutter/blocs/blocs.dart';
import 'package:zenon_syrius_wallet_flutter/main.dart';
import 'package:zenon_syrius_wallet_flutter/utils/account_block_utils.dart';
import 'package:znn_sdk_dart/znn_sdk_dart.dart';

class CreatePhaseBloc extends BaseBloc<AccountBlockTemplate?> {
void createPhase(
Future<void> createPhase(
Hash id,
String name,
String description,
String url,
int znnFundsNeeded,
int qsrFundsNeeded,
) {
) async {
try {
addEvent(null);
AccountBlockTemplate transactionParams =
Expand All @@ -29,11 +29,11 @@ class CreatePhaseBloc extends BaseBloc<AccountBlockTemplate?> {
)
.onError(
(error, stackTrace) {
addError(error.toString());
addError(error, stackTrace);
},
);
} catch (e) {
addError(e);
} catch (e, stackTrace) {
addError(e, stackTrace);
}
}
}
11 changes: 5 additions & 6 deletions lib/blocs/accelerator/create_project_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:zenon_syrius_wallet_flutter/blocs/base_bloc.dart';
import 'package:zenon_syrius_wallet_flutter/blocs/blocs.dart';
import 'package:zenon_syrius_wallet_flutter/main.dart';
import 'package:zenon_syrius_wallet_flutter/utils/account_block_utils.dart';
import 'package:zenon_syrius_wallet_flutter/utils/address_utils.dart';
import 'package:zenon_syrius_wallet_flutter/utils/utils.dart';
import 'package:znn_sdk_dart/znn_sdk_dart.dart';

class CreateProjectBloc extends BaseBloc<AccountBlockTemplate?> {
Expand Down Expand Up @@ -32,11 +31,11 @@ class CreateProjectBloc extends BaseBloc<AccountBlockTemplate?> {
},
).onError(
(error, stackTrace) {
addError(error.toString());
addError(error, stackTrace);
},
);
} catch (e) {
addError(e);
} catch (e, stackTrace) {
addError(e, stackTrace);
}
}
}
Loading

0 comments on commit c996cc4

Please sign in to comment.