Skip to content

Commit

Permalink
github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ddd-mtl committed May 29, 2023
1 parent 311b205 commit a2ff7e1
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/build-webhapps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: build-webhapps

on:
workflow_call:

jobs:
build-webhapps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Install npm dependencies
- name: Install npm dependencies
shell: bash
run: |
npm install
# Download submodules
- name: Download submodules
shell: bash
run: |
npm run install:submodules
# install rust tools
- name: install rust tools
shell: bash
run: |
npm run install:rust
# install hc tool
- name: Install hc tool
shell: bash
run: |
npm run install:hc
# Install hash-zome
- name: Install hash-zome
run: |
npm run install:hash-zome
# Build happ
- name: Build happ
shell: bash
run: |
npm run build:happ
# Build webapp
- name: Build webapp
run: |
npm run build:webapp
# Package web-happ
- name: Package web-happ
run: |
npm run package:webapp
# build we-applet
- name: build we-applet
shell: bash
run: |
npm run build -w we-applet
# Package we-applet
- name: Package we-applet
shell: bash
run: |
npm run package:we-applet
# Regroup artifacts
- name: Regroup artifacts
run: |
cp target/wasm32-unknown-unknown/release/threads_integrity_zome.wasm ./artifacts
cp target/wasm32-unknown-unknown/release/threads_zome.wasm ./artifacts
cp target/wasm32-unknown-unknown/release/profiles_zome.wasm ./artifacts
cp target/wasm32-unknown-unknown/release/profiles_integrity_zome.wasm ./artifacts
# List uploaded files
- name: List uploaded files
run: ls -R
working-directory: ./artifacts
# "upload" artifacts
- uses: actions/upload-artifact@master
with:
name: all-happ-artifact
path: artifacts/
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release x64

on:
push:
tags:
- v[0-9]+.*

jobs:
call-build:
uses: ./.github/workflows/build-webhapps.yml
secrets: inherit

# upload the artifacts
upload-assets:
needs: call-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Download previously uploaded artifacts
- uses: actions/download-artifact@v3
with:
name: all-happ-artifact
path: artifacts
# Display artifacts folder
- name: Display artifacts folder
run: ls
working-directory: artifacts
# upload all artifacts
- name: upload binary (ubuntu only)
if: ${{ runner.os == 'Linux' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: artifacts
run: |
rm -f *.blockmap
echo threads*
gh release upload "${GITHUB_REF#refs/tags/}" threads* --clobber
echo Threads*
gh release upload "${GITHUB_REF#refs/tags/}" Threads* --clobber
echo profiles*
gh release upload "${GITHUB_REF#refs/tags/}" profiles_zome.wasm --clobber
gh release upload "${GITHUB_REF#refs/tags/}" profiles_integrity_zome.wasm --clobber
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: test-workflow x64

on: workflow_dispatch

jobs:
call-build:
uses: ./.github/workflows/build-webhapps.yml
secrets: inherit

# upload the artifacts
upload-assets:
needs: call-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Download previously uploaded artifacts
- uses: actions/download-artifact@v3
with:
name: all-happ-artifact
path: artifacts
# Display artifacts folder
- name: Display artifacts folder
run: ls
working-directory: artifacts
# upload all artifacts
- name: upload binary (ubuntu only)
if: ${{ runner.os == 'Linux' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: artifacts
run: |
rm -f *.blockmap
echo threads*
gh release upload "manual-release" threads* --clobber
echo Threads*
gh release upload "manual-release" Threads* --clobber
echo profiles*
gh release upload "manual-release" profiles_zome.wasm --clobber
gh release upload "manual-release" profiles_integrity_zome.wasm --clobber

0 comments on commit a2ff7e1

Please sign in to comment.