Skip to content

Commit 072d236

Browse files
author
tommyjk21
authored
Merge pull request #40 from Manta-Network/add-release-workflow
Add workflow
2 parents 0879a43 + 7a1392b commit 072d236

File tree

10 files changed

+181
-13
lines changed

10 files changed

+181
-13
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
2+
v ✰ Thanks for creating a PR! ✰
3+
v Before hitting that submit button please review the checkboxes.
4+
v If a checkbox is n/a - please still include it but + a little note why
5+
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -->
6+
7+
## Description
8+
9+
<!-- Add a description of the changes that this PR introduces and the files that
10+
are the most critical to review.
11+
-->
12+
13+
closes: #XXXX
14+
15+
---
16+
17+
Before we can merge this PR, please make sure that all the following items have been
18+
checked off. If any of the checklist items are not applicable, please leave them but
19+
write a little note why.
20+
21+
- [ ] Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
22+
- [ ] Test following procedure in docs/testing-workflow.md
23+
- [ ] Updated relevant documentation in the code.
24+
- [ ] Re-reviewed `Files changed` in the Github PR explorer.
25+
- [ ] Update the version numbers properly:
26+
* Cargo.toml
27+
* ui/src-tauri/Cargo.toml
28+
* ui/src-tauri/tauri.conf.json
29+
* ui/public/about.html
30+
* ui/package.json

.github/workflows/release.yml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: Build and upload binaries
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
release:
8+
types: [published]
9+
10+
jobs:
11+
setup:
12+
name: Get version
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- run: echo "VERSION=$(cat Cargo.toml | grep ^version | awk -F'=' '{print $2}' | tr -d '\" ')" >> $GITHUB_ENV
17+
outputs:
18+
release_version: ${{ env.VERSION }}
19+
build:
20+
name: Build
21+
needs: setup
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
matrix:
25+
include:
26+
- os: ubuntu-latest
27+
os_type: ubuntu
28+
artifact_name: manta-signer
29+
asset_name: manta-signer-linux-amd64
30+
- os: windows-2019
31+
os_type: windows
32+
artifact_name: manta-signer
33+
asset_name: manta-signer-windows
34+
- os: macos-latest
35+
os_type: macos
36+
artifact_name: manta-signer
37+
asset_name: manta-signer-macos-amd64
38+
- os: macos-10.15
39+
os_type: macos
40+
artifact_name: manta-signer
41+
asset_name: manta-signer-macos-amd64
42+
steps:
43+
- name: Checkout code
44+
uses: actions/checkout@v2
45+
- name: Cache Cargo build dir
46+
uses: actions/cache@v2
47+
env:
48+
cache-name: cache-cargo
49+
with:
50+
path: ~/.cargo
51+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./ui/src-tauri/Cargo.lock') }}
52+
restore-keys: |
53+
${{ runner.os }}-build-${{ env.cache-name }}-
54+
${{ runner.os }}-build-
55+
${{ runner.os }}-
56+
- name: Cache target dir
57+
uses: actions/cache@v2
58+
env:
59+
cache-name: cache-target
60+
with:
61+
path: ui/src-tauri/target
62+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./ui/src-tauri/Cargo.lock') }}
63+
restore-keys: |
64+
${{ runner.os }}-build-${{ env.cache-name }}-
65+
${{ runner.os }}-build-
66+
${{ runner.os }}-
67+
- name: Fetch reclaim_pk.bin
68+
run: cd ui/src-tauri;curl -OL 'https://github.com/Manta-Network/sdk/raw/main/zkp/reclaim_pk.bin'
69+
- name: Fetch transfer_pk.bin
70+
run: cd ui/src-tauri;curl -OL 'https://github.com/Manta-Network/sdk/raw/main/zkp/transfer_pk.bin'
71+
- name: Hack For Ubuntu Builds
72+
run: cd ui/src-tauri; sed -i /icns/d tauri.conf.json
73+
if: matrix.os_type == 'ubuntu'
74+
- name: Ubuntu Build Dependencies
75+
run: sudo apt-get update && sudo apt-get -y install libwebkit2gtk-4.0-dev libgtk-3-dev libappindicator3-dev patchelf librsvg2-dev
76+
if: matrix.os_type == 'ubuntu'
77+
- name: Build
78+
run: cd ui;yarn && yarn tauri build
79+
- name: Get release
80+
id: get_release
81+
uses: bruceadams/get-release@v1.2.3
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
if: github.event_name == 'release' && github.event.action == 'published'
85+
- name: Upload .deb Package
86+
uses: actions/upload-release-asset@v1
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
with:
90+
upload_url: ${{ steps.get_release.outputs.upload_url }}
91+
asset_path: ui/src-tauri/target/release/bundle/deb/manta-signer_${{ needs.setup.outputs.release_version }}_amd64.deb
92+
asset_name: manta-signer-${{ matrix.os }}_${{ needs.setup.outputs.release_version }}_amd64.deb
93+
asset_content_type: application/binary
94+
if: matrix.os_type == 'ubuntu' && github.event_name == 'release' && github.event.action == 'published'
95+
- name: Upload AppImage Package
96+
uses: actions/upload-release-asset@v1
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
with:
100+
upload_url: ${{ steps.get_release.outputs.upload_url }}
101+
asset_path: ui/src-tauri/target/release/bundle/appimage/manta-signer_${{ needs.setup.outputs.release_version }}_amd64.AppImage
102+
asset_name: manta-signer-${{ matrix.os }}_${{ needs.setup.outputs.release_version }}_amd64.AppImage
103+
asset_content_type: application/binary
104+
if: matrix.os_type == 'ubuntu' && github.event_name == 'release' && github.event.action == 'published'
105+
- name: Upload MS Installer
106+
uses: actions/upload-release-asset@v1
107+
env:
108+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109+
with:
110+
upload_url: ${{ steps.get_release.outputs.upload_url }}
111+
asset_path: "ui/src-tauri/target/release/bundle/msi/manta-signer_${{ needs.setup.outputs.release_version }}_x64.msi"
112+
asset_name: "manta-signer-${{ matrix.os }}_${{ needs.setup.outputs.release_version }}_x64.msi"
113+
asset_content_type: application/binary
114+
if: matrix.os_type == 'windows' && github.event_name == 'release' && github.event.action == 'published'
115+
- name: Upload Mac Image
116+
uses: actions/upload-release-asset@v1
117+
env:
118+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119+
with:
120+
upload_url: ${{ steps.get_release.outputs.upload_url }}
121+
asset_path: "ui/src-tauri/target/release/bundle/dmg/manta-signer_${{ needs.setup.outputs.release_version }}_x64.dmg"
122+
asset_name: "manta-signer-${{ matrix.os }}_${{ needs.setup.outputs.release_version }}_x64.dmg"
123+
asset_content_type: application/binary
124+
if: matrix.os_type == 'macos' && github.event_name == 'release' && github.event.action == 'published'

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "manta-signer"
33
edition = "2018"
4-
version = "0.5.0"
4+
version = "0.5.1"
55
authors = ["Manta Network <contact@manta.network>"]
66
readme = "README.md"
77
license-file = "LICENSE"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ Disclaimer: `manta-signer` is experimental software, use it at your own risk.
1212
-src: manta-signer zkp generation
1313
-ui: manta-signer desktop UI
1414
```
15+

ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "manta-signer-ui",
3-
"version": "0.5.0",
3+
"version": "0.5.1",
44
"private": true,
55
"dependencies": {
66
"@tauri-apps/api": "^1.0.0-beta.8",
@@ -43,4 +43,4 @@
4343
"devDependencies": {
4444
"@tauri-apps/cli": "^1.0.0-beta.10"
4545
}
46-
}
46+
}

ui/public/about.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<main>
3939
<img src="Square89x89Logo.png" />
4040
<h3>Manta Signer</h3>
41-
<p>Version 0.5.0</p>
41+
<p>Version 0.5.1</p>
4242
<p>Copyright © 2019-2021 Manta Network</p>
4343
<p>
4444
<a href="https://github.com/manta-network/manta-signer">manta-network/manta-signer</a>
@@ -48,4 +48,4 @@ <h3>Manta Signer</h3>
4848
</main>
4949
</body>
5050

51-
</html>
51+
</html>

ui/src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "manta-signer-ui"
33
edition = "2018"
4-
version = "0.5.0"
4+
version = "0.5.1"
55
authors = ["Manta Network <contact@manta.network>"]
66
readme = "README.md"
77
license-file = "LICENSE"

ui/src-tauri/icons/tray.png

18.3 KB
Loading

ui/src-tauri/src/main.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ impl User {
8080
/// Pulls resources from `self.resource_directory` and moves them to the proving key directory.
8181
#[inline]
8282
async fn setup_resources(&self, config: &Config) {
83-
// FIXME: Make sure this function will work on all platforms.
8483
if !self.resource_directory.exists().await {
8584
// NOTE: If this file does not exist, then we are in development mode.
8685
return;
@@ -102,6 +101,21 @@ impl User {
102101
.await
103102
.expect("Copy should have succeeded.");
104103
}
104+
} else if entry.path().to_str().unwrap().ends_with(".bin") {
105+
let mut bins = fs::read_dir(&entry.path())
106+
.await
107+
.expect("The resource directory should be a directory.");
108+
while let Some(entry) = bins.next().await {
109+
let path = entry.expect("Unable to get directory entry.").path();
110+
fs::copy(
111+
&path,
112+
&config
113+
.proving_key_directory
114+
.join(&path.file_name().expect("Path should point to a real file.")),
115+
)
116+
.await
117+
.expect("Copy should have succeeded.");
118+
}
105119
}
106120
}
107121
}

ui/src-tauri/tauri.conf.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"package": {
3-
"productName": "Manta Signer",
4-
"version": "0.5.0"
3+
"productName": "manta-signer",
4+
"version": "0.5.1"
55
},
66
"build": {
77
"distDir": "../build",
@@ -19,7 +19,6 @@
1919
"icons/32x32.png",
2020
"icons/128x128.png",
2121
"icons/128x128@2x.png",
22-
"icons/icon.icns",
2322
"icons/icon.ico"
2423
],
2524
"resources": ["*.bin"],
@@ -71,12 +70,12 @@
7170
"url": "about.html",
7271
"width": 350,
7372
"height": 270,
74-
"alwaysOnTop": true,
73+
"alwaysOnTop": false,
7574
"center": true,
7675
"decorations": true,
7776
"resizable": false,
7877
"transparent": false,
79-
"visible": false
78+
"visible": true
8079
}
8180
],
8281
"security": {
@@ -87,4 +86,4 @@
8786
"iconAsTemplate": true
8887
}
8988
}
90-
}
89+
}

0 commit comments

Comments
 (0)