Skip to content

Commit

Permalink
Merge branch 'rust-refactor' of github.com:perspect3vism/ad4m-executo…
Browse files Browse the repository at this point in the history
…r into rust-refactor
  • Loading branch information
jdeepee committed Sep 18, 2023
2 parents f783cda + 73cb513 commit f1c19fd
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 44 deletions.
46 changes: 29 additions & 17 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.32.4

- name: Install HC
run: cargo install holochain_cli --git https://github.com/coasys/holochain || echo "hc already installed"

- name: Create Tags From
id: create_tag
uses: jaywcjlove/[email protected]
Expand All @@ -48,7 +48,7 @@ jobs:
platform: [GH-hosted-ubuntu, macos-latest, windows-latest]
node-version: [18.17.0]

needs:
needs:
- create-release
- npm-publish

Expand Down Expand Up @@ -122,32 +122,44 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/work/ad4m/ad4m/target/release/bundle/deb/adam-launcher${{ steps.extract_version.outputs.version }}_amd64.deb
asset_name: adam-launcher${{ steps.extract_version.outputs.version }}_amd64.deb
asset_path: /home/runner/work/ad4m/ad4m/target/release/bundle/deb/adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.deb
asset_name: adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.deb
asset_content_type: application/octet-stream

- name: Upload Release AppImage Asset
id: upload-release-appimage-asset
if: matrix.platform == 'GH-hosted-ubuntu'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/work/ad4m/ad4m/target/release/bundle/deb/adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.AppImage
asset_name: adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.AppImage
asset_content_type: application/octet-stream

- name: Upload Release Deb Update Asset
id: upload-release-deb-asset-update
- name: Upload Release AppImage Update Asset
id: upload-release-appimage-asset-update
if: matrix.platform == 'ubuntu-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/work/ad4m/ad4m/target/release/bundle/deb/adam-launcher${{ steps.extract_version.outputs.version }}_amd64.deb.tar.gz
asset_name: adam-launcher${{ steps.extract_version.outputs.version }}_amd64.deb.tar.gz
asset_path: /home/runner/work/ad4m/ad4m/target/release/bundle/deb/adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.AppImage.tar.gz
asset_name: adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.deb.tar.gz
asset_content_type: application/octet-stream

- name: Upload Release Deb update sig Asset
id: upload-release-deb-asset-update-sig
- name: Upload Release AppImage update sig Asset
id: upload-release-appimage-asset-update-sig
if: matrix.platform == 'ubuntu-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/work/ad4m/ad4m/target/release/bundle/deb/adam-launcher${{ steps.extract_version.outputs.version }}_amd64.deb.tar.gz.sig
asset_name: adam-launcher${{ steps.extract_version.outputs.version }}_amd64.deb.tar.gz.sig
asset_path: /home/runner/work/ad4m/ad4m/target/release/bundle/deb/adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.AppImage.tar.gz.sig
asset_name: adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.deb.tar.gz.sig
asset_content_type: application/octet-stream

- name: Upload Release AD4M CLI Linux Binary
Expand Down Expand Up @@ -233,7 +245,7 @@ jobs:
asset_path: D:\a\ad4m\ad4m\target\release\bundle\msi\ADAM\ Launcher_${{ steps.extract_version.outputs.version }}_x64_en-US.msi.zip
asset_name: ADAM\ Launcher_${{ steps.extract_version.outputs.version }}_x64_en-US.msi.zip
asset_content_type: application/octet-stream

- name: Upload Release MSI update sig Asset
id: upload-release-msi-asset-update-sig
if: matrix.platform == 'windows-latest'
Expand All @@ -257,7 +269,7 @@ jobs:
asset_path: D:\a\ad4m\ad4m\target\release\ad4m-x64.exe
asset_name: ad4m-windows-${{ steps.extract_version.outputs.version }}-x64.exe
asset_content_type: application/octet-stream

npm-publish:
runs-on: GH-hosted-ubuntu
steps:
Expand Down Expand Up @@ -306,8 +318,8 @@ jobs:
with:
token: ${{ secrets.NPM_TOKEN }}
package: test-runner/package.json


crates-publish:
runs-on: GH-hosted-ubuntu
steps:
Expand Down
58 changes: 35 additions & 23 deletions .github/workflows/publish_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
platform: [GH-hosted-ubuntu, macos-latest, windows-latest]
node-version: [18.17.0]

needs:
needs:
- create-release

runs-on: ${{ matrix.platform }}
Expand Down Expand Up @@ -119,32 +119,44 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/work/ad4m/ad4m/target/release/bundle/deb/adam-launcher${{ steps.extract_version.outputs.version }}_amd64.deb
asset_name: adam-launcher${{ steps.extract_version.outputs.version }}_amd64.deb
asset_path: /home/runner/work/ad4m/ad4m/target/release/bundle/deb/adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.deb
asset_name: adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.deb
asset_content_type: application/octet-stream

- name: Upload Release Deb Update Asset
id: upload-release-deb-asset-update
- name: Upload Release AppImage Asset
id: upload-release-appimage-asset
if: matrix.platform == 'GH-hosted-ubuntu'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/work/ad4m/ad4m/target/release/bundle/deb/adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.AppImage
asset_name: adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.AppImage
asset_content_type: application/octet-stream

- name: Upload Release AppImage Update Asset
id: upload-release-appimage-asset-update
if: matrix.platform == 'ubuntu-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/work/ad4m/ad4m/target/release/bundle/deb/adam-launcher${{ steps.extract_version.outputs.version }}_amd64.deb.tar.gz
asset_name: adam-launcher${{ steps.extract_version.outputs.version }}_amd64.deb.tar.gz
asset_path: /home/runner/work/ad4m/ad4m/target/release/bundle/deb/adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.AppImage.tar.gz
asset_name: adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.deb.tar.gz
asset_content_type: application/octet-stream

- name: Upload Release Deb update sig Asset
id: upload-release-deb-asset-update-sig
- name: Upload Release AppImage update sig Asset
id: upload-release-appimage-asset-update-sig
if: matrix.platform == 'ubuntu-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/work/ad4m/ad4m/target/release/bundle/deb/adam-launcher${{ steps.extract_version.outputs.version }}_amd64.deb.tar.gz.sig
asset_name: adam-launcher${{ steps.extract_version.outputs.version }}_amd64.deb.tar.gz.sig
asset_path: /home/runner/work/ad4m/ad4m/target/release/bundle/deb/adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.AppImage.tar.gz.sig
asset_name: adam-launcher_${{ steps.extract_version.outputs.version }}_amd64.deb.tar.gz.sig
asset_content_type: application/octet-stream

- name: Upload Release AD4M CLI Linux Binary
Expand All @@ -167,7 +179,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /Users/runner/work/ad4m/ad4m/target/release/bundle/dmg/ADAM\ Launcher_${{ steps.extract_version.outputs.version }}_x64.dmg
asset_path: "/Users/runner/work/ad4m/target/release/bundle/dmg/ADAM Launcher_${{ steps.extract_version.outputs.version }}_x64.dmg"
asset_name: ADAM\ Launcher_${{ steps.extract_version.outputs.version }}_x64.dmg
asset_content_type: application/octet-stream

Expand All @@ -179,7 +191,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /Users/runner/work/ad4m/ad4m/target/release/bundle/dmg/ADAM\ Launcher_${{ steps.extract_version.outputs.version }}_x64.dmg.tar.gz
asset_path: "/Users/runner/work/ad4m/target/release/bundle/dmg/ADAM Launcher_${{ steps.extract_version.outputs.version }}_x64.dmg.tar.gz"
asset_name: ADAM\ Launcher_${{ steps.extract_version.outputs.version }}_x64.tar.gz
asset_content_type: application/octet-stream

Expand All @@ -191,7 +203,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /Users/runner/work/ad4m/ad4m/target/release/bundle/dmg/ADAM\ Launcher_${{ steps.extract_version.outputs.version }}_x64.tar.gz.sig
asset_path: "/Users/runner/work/ad4m/target/release/bundle/dmg/ADAM Launcher_${{ steps.extract_version.outputs.version }}_x64.tar.gz.sig"
asset_name: ADAM\ Launcher_${{ steps.extract_version.outputs.version }}_x64.dmg.tar.gz.sig
asset_content_type: application/octet-stream

Expand All @@ -203,7 +215,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /Users/runner/work/ad4m/ad4m/target/release/ad4m
asset_path: /Users/runner/work/ad4m/target/release/ad4m
asset_name: ad4m-macos-${{ steps.extract_version.outputs.version }}-x64
asset_content_type: application/octet-stream

Expand All @@ -215,7 +227,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: D:\a\ad4m\ad4m\target\release\bundle\msi\ADAM\ Launcher_${{ steps.extract_version.outputs.version }}_x64_en-US.msi
asset_path: 'D:\a\ad4m\ad4m\target\release\bundle\msi\ADAM Launcher_${{ steps.extract_version.outputs.version }}_x64_en-US.msi'
asset_name: ADAM\ Launcher_${{ steps.extract_version.outputs.version }}_x64_en-US.msi
asset_content_type: application/octet-stream

Expand All @@ -227,10 +239,10 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: D:\a\ad4m\ad4m\target\release\bundle\msi\ADAM\ Launcher_${{ steps.extract_version.outputs.version }}_x64_en-US.msi.zip
asset_path: 'D:\a\ad4m\ad4m\target\release\bundle\msi\ADAM Launcher_${{ steps.extract_version.outputs.version }}_x64_en-US.msi.zip'
asset_name: ADAM\ Launcher_${{ steps.extract_version.outputs.version }}_x64_en-US.msi.zip
asset_content_type: application/octet-stream

- name: Upload Release MSI update sig Asset
id: upload-release-msi-asset-update-sig
if: matrix.platform == 'windows-latest'
Expand All @@ -239,7 +251,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: D:\a\ad4m\ad4m\target\release\bundle\msi\ADAM\ Launcher_${{ steps.extract_version.outputs.version }}_x64_en-US.msi.zip.sig
asset_path: 'D:\a\ad4m\ad4m\target\release\bundle\msi\ADAM Launcher_${{ steps.extract_version.outputs.version }}_x64_en-US.msi.zip.sig'
asset_name: ADAM\ Launcher_${{ steps.extract_version.outputs.version }}_x64_en-US.msi.zip.sig
asset_content_type: application/octet-stream

Expand All @@ -254,7 +266,7 @@ jobs:
asset_path: D:\a\ad4m\ad4m\target\release\ad4m-x64.exe
asset_name: ad4m-windows-${{ steps.extract_version.outputs.version }}-x64.exe
asset_content_type: application/octet-stream

npm-publish:
runs-on: GH-hosted-ubuntu
steps:
Expand Down Expand Up @@ -303,7 +315,7 @@ jobs:
else
echo "NPM_TAG=latest" >> $GITHUB_ENV
fi
- name: Publish core
uses: JS-DevTools/npm-publish@v1
with:
Expand Down Expand Up @@ -331,8 +343,8 @@ jobs:
token: ${{ secrets.NPM_TOKEN }}
package: test-runner/package.json
tag: ${{ env.NPM_TAG }}


crates-publish:
runs-on: GH-hosted-ubuntu
steps:
Expand Down
13 changes: 13 additions & 0 deletions setVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@ const rustClient = replaceVersionLine(fs.readFileSync('rust-client/Cargo.toml',
console.log("rust-client version: " + rustClient.oldVersion + " -> " + VERSION)
fs.writeFileSync('rust-client/Cargo.toml', rustClient.newContent)

const rustExecutorCargo = replaceVersionLine(fs.readFileSync('rust-executor/Cargo.toml', 'utf8'), VERSION)
console.log("rust-executor version: " + rustExecutorCargo.oldVersion + " -> " + VERSION)
fs.writeFileSync('rust-executor/Cargo.toml', rustExecutorCargo.newContent)

const globalsRs = replaceVersionLine(
fs.readFileSync('rust-executor/src/globals.rs', 'utf8'),
VERSION,
` pub static ref AD4M_VERSION: String = String::from(`,
`);`
)
console.log("globals.rs version: " + globalsRs.oldVersion + " -> " + VERSION)
fs.writeFileSync('rust-executor/src/globals.rs', globalsRs.newContent)

const uiPackage = JSON.parse(fs.readFileSync('ui/package.json', 'utf8'))
if (isPreRelease) {
console.log("UI version: " + uiPackage.version + " -> " + VERSION)
Expand Down
2 changes: 1 addition & 1 deletion ui/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ directories = "4.0.1"
opener = "0.5.0"
open = "2.0.1"
sysinfo = "0.29.7"
tauri = { version = "1.4.1", features = ["api-all", "system-tray", "updater"] }
tauri = { version = "1.4.1", features = [ "updater", "api-all", "system-tray"] }
uuid = { version = "0.8", features = ["v4"] }
localtunnel-client = "0.0.12"
tokio = { version = "1.19.2", features = ["full"] }
Expand Down
8 changes: 5 additions & 3 deletions ui/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
"bundle": {
"active": true,
"targets": [
"appimage",
"deb",
"msi",
"dmg",
"updater",
"app",
"appimage"
"updater"
],
"identifier": "dev.ad4m.ad4min",
"icon": [
Expand All @@ -41,6 +40,9 @@
"deb": {
"depends": []
},
"appimage": {
"bundleMediaFramework": true
},
"macOS": {
"frameworks": [],
"minimumSystemVersion": "",
Expand Down

0 comments on commit f1c19fd

Please sign in to comment.