Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build executables #3

Merged
merged 30 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 83 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ concurrency:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -39,9 +40,89 @@ jobs:
run: cargo fmt --all -- --files-with-diff --check

build:
runs-on: ubuntu-latest
name: Bundle ${{ matrix.platform_name }}
runs-on: ${{ matrix.platform }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest'
platform_name: MacOS ARM64
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest'
platform_name: MacOS x86_64
args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-22.04'
platform_name: Linux
args: ''
- platform: 'windows-latest'
platform_name: Windows
args: ''
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
- name: Get release
if: startsWith(github.event.ref, 'refs/tags/v')
id: get_release
uses: actions/github-script@v6
with:
script: |
const tag = process.env.GITHUB_REF.split('/').pop();
const release = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: tag,
});
return release.data.id;

- name: Install x86_64-apple-darwin target
if: matrix.platform_name == 'MacOS x86_64'
run: rustup target add x86_64-apple-darwin

- name: Ubuntu dependencies
if: matrix.platform == 'ubuntu-22.04'
run: sudo apt-get install -y libgtk-3-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev

- name: Windows dependencies
if: matrix.platform == 'windows-latest'
run: |
choco install nasm
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Frontend dependencies
run: pnpm install

- name: Save API key to file
if: ${{ matrix.platform == 'macos-latest' && startsWith(github.event.ref, 'refs/tags/v') }}
run: |
mkdir -p ~/private_keys
echo -n '${{ secrets.APPLE_API_SECRET_KEY }}' > ~/private_keys/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8

- name: Apple signing variables
if: ${{ matrix.platform == 'macos-latest' && startsWith(github.event.ref, 'refs/tags/v') }}
run: |
echo "APPLE_CERTIFICATE=${{ secrets.APPLE_CERTIFICATE }}" >> $GITHUB_ENV
echo "APPLE_CERTIFICATE_PASSWORD=${{ secrets.APPLE_CERTIFICATE_PASSWORD }}" >> $GITHUB_ENV
echo "APPLE_API_ISSUER=${{ secrets.APPLE_API_ISSUER }}" >> $GITHUB_ENV
echo "APPLE_API_KEY=${{ secrets.APPLE_API_KEY_ID }}" >> $GITHUB_ENV
echo "APPLE_API_KEY_PATH=~/private_keys/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8" >> $GITHUB_ENV

- name: Dry run
if: ${{ !startsWith(github.event.ref, 'refs/tags/v') }}
run: pnpm tauri build ${{ matrix.args }}

- name: Publish
uses: tauri-apps/tauri-action@v0
if: ${{ startsWith(github.event.ref, 'refs/tags/v') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI: true
with:
releaseId: ${{ steps.get_release.outputs.result }}
args: ${{ matrix.args }}
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ tauri-specta = "=2.0.0-rc.18"
# Chia
chia = "0.13.0"
clvmr = "0.8.0"
chia-wallet-sdk = { git = "https://github.com/Rigidity/chia-wallet-sdk", branch = "sage" }
chia-wallet-sdk = { git = "https://github.com/xch-dev/chia-wallet-sdk", rev = "1461c0e77d687b73b59e440044ad6c7d35c49581" }
bip39 = "2.0.0"
bech32 = "0.9.1"

Expand Down
4 changes: 0 additions & 4 deletions src-tauri/.cargo/config.toml

This file was deleted.

9 changes: 5 additions & 4 deletions src-tauri/src/commands/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ use chia::{
puzzles::DeriveSynthetic,
};
use chia_wallet_sdk::{
decode_address, Peer, RequiredSignature, MAINNET_CONSTANTS, TESTNET11_CONSTANTS,
decode_address, AggSigConstants, Peer, RequiredSignature, MAINNET_CONSTANTS,
TESTNET11_CONSTANTS,
};
use clvmr::Allocator;
use sage_api::Amount;
Expand Down Expand Up @@ -258,10 +259,10 @@ async fn transact(
let required_signatures = RequiredSignature::from_coin_spends(
&mut Allocator::new(),
&coin_spends,
if state.config.network.network_id == "mainnet" {
&MAINNET_CONSTANTS
&if state.config.network.network_id == "mainnet" {
AggSigConstants::new(MAINNET_CONSTANTS.agg_sig_me_additional_data)
} else {
&TESTNET11_CONSTANTS
AggSigConstants::new(TESTNET11_CONSTANTS.agg_sig_me_additional_data)
},
)?;

Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"productName": "sage",
"productName": "Sage",
"version": "0.1.0",
"identifier": "com.rigidnetwork.sage",
"build": {
Expand Down