diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a6e393e4d..93fceae66 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -8,16 +8,56 @@ env: NODE_VERSION: "18.x" jobs: + build-axolotl-web: + name: Build axolotl-web + runs-on: ubuntu-latest + + steps: + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Check out code + uses: actions/checkout@v3 + + - name: Download dependencies + run: npm --prefix ./axolotl-web ci --loglevel verbose + + - name: Run tests + run: npm --prefix ./axolotl-web test + + - name: Lint application + run: npm --prefix ./axolotl-web run lint + + - name: Analyze npm dependencies + run: npm --prefix ./axolotl-web run depcheck + + - name: Build + run: npm --prefix ./axolotl-web run build + + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: axolotl-web + path: axolotl-web/dist/ + retention-days: 1 build-axolotl: name: Build axolotl runs-on: ubuntu-latest - + needs: + - build-axolotl-web steps: - name: Rust setup uses: dtolnay/rust-toolchain@stable - name: Rust cache uses: swatinem/rust-cache@v2 + + - name: Download axolotl-web build artifacts + uses: actions/download-artifact@v3 + with: + path: build-artifacts - name: Install dependencies run: sudo apt update && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev librsvg2-dev libayatana-appindicator3-dev libssl-dev libjavascriptcoregtk-4.1-dev cmake @@ -25,6 +65,12 @@ jobs: - name: Check out code uses: actions/checkout@v3 + + - name: Copy axolotl-web build artifacts + run: | + mkdir --parents $GITHUB_WORKSPACE/axolotl-web/dist + cp --recursive $GITHUB_WORKSPACE/build-artifacts/axolotl-web/dist $GITHUB_WORKSPACE/axolotl-web/dist + cp --recursive $GITHUB_WORKSPACE/build-artifacts/guis $GITHUB_WORKSPACE/guis - name: Build run: make build-axolotl @@ -36,99 +82,64 @@ jobs: path: axolotl retention-days: 1 - # build-axolotl-web: - # name: Build axolotl-web - # runs-on: ubuntu-latest - - # steps: - # - name: Setup Node - # uses: actions/setup-node@v3 - # with: - # node-version: ${{ env.NODE_VERSION }} - - # - name: Check out code - # uses: actions/checkout@v3 - - # - name: Download dependencies - # run: npm --prefix ./axolotl-web ci --loglevel verbose - - # - name: Run tests - # run: npm --prefix ./axolotl-web test - - # - name: Lint application - # run: npm --prefix ./axolotl-web run lint - - # - name: Analyze npm dependencies - # run: npm --prefix ./axolotl-web run depcheck - - # - name: Build - # run: npm --prefix ./axolotl-web run build - - # - name: Upload build artifacts - # uses: actions/upload-artifact@v3 - # with: - # name: axolotl-web - # path: axolotl-web/dist/ - # retention-days: 1 - - # build-axolotl-deb-arm64: - # name: Build axolotl Debian arm64 - # runs-on: ubuntu-latest - - # steps: - # - name: Install Rust - # run: rustup update stable - # - name: Install cross-compilation tools - # uses: taiki-e/setup-cross-toolchain-action@v1 - # with: - # target: aarch64-unknown-linux-gnu - - # - name: Rust cache - # uses: swatinem/rust-cache@v2 - - # - name: Check out code - # uses: actions/checkout@v3 - - # - name: Build - # run: cargo build --release --target aarch64-unknown-linux-gnu --features tauri - - # - name: Upload build artifacts - # uses: actions/upload-artifact@v3 - # with: - # name: linux-arm64 - # path: build/linux-arm64/axolotl - # retention-days: 1 - - # build-axolotl-web-deb-arm64: - # name: Build axolotl-web Debian arm64 - # runs-on: ubuntu-latest - - # steps: - # - name: Set up Node - # uses: actions/setup-node@v3 - # with: - # node-version: ${{ env.NODE_VERSION }} - - # - name: Check out code - # uses: actions/checkout@v3 - - # - name: Create folder - # run: mkdir --parents $GITHUB_WORKSPACE/build/linux-arm64/axolotl-web - - # - name: Download dependencies - # run: npm --prefix ./axolotl-web --target_arch=arm64 ci --loglevel verbose - - # - name: Build - # run: npm --prefix ./axolotl-web --target_arch=arm64 run build - - # - name: Copy build files - # run: | - # cp --recursive $GITHUB_WORKSPACE/axolotl-web/dist $GITHUB_WORKSPACE/build/linux-arm64/axolotl-web/ - # cp --recursive $GITHUB_WORKSPACE/guis $GITHUB_WORKSPACE/build/linux-arm64/ - - # - name: Upload build artifacts - # uses: actions/upload-artifact@v3 - # with: - # name: linux-arm64 - # path: build/linux-arm64/ - # retention-days: 1 + build-axolotl-deb-arm64: + name: Build axolotl Debian arm64 + runs-on: ubuntu-latest + + steps: + - name: Install Rust + run: rustup update stable + - name: Install cross-compilation tools + uses: taiki-e/setup-cross-toolchain-action@v1 + with: + target: aarch64-unknown-linux-gnu + + - name: Rust cache + uses: swatinem/rust-cache@v2 + + - name: Check out code + uses: actions/checkout@v3 + + - name: Build + run: cargo build --release --target aarch64-unknown-linux-gnu --features tauri + + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: linux-arm64 + path: build/linux-arm64/axolotl + retention-days: 1 + + build-axolotl-web-deb-arm64: + name: Build axolotl-web Debian arm64 + runs-on: ubuntu-latest + + steps: + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Check out code + uses: actions/checkout@v3 + + - name: Create folder + run: mkdir --parents $GITHUB_WORKSPACE/build/linux-arm64/axolotl-web + + - name: Download dependencies + run: npm --prefix ./axolotl-web --target_arch=arm64 ci --loglevel verbose + + - name: Build + run: npm --prefix ./axolotl-web --target_arch=arm64 run build + + - name: Copy build files + run: | + cp --recursive $GITHUB_WORKSPACE/axolotl-web/dist $GITHUB_WORKSPACE/build/linux-arm64/axolotl-web/ + cp --recursive $GITHUB_WORKSPACE/guis $GITHUB_WORKSPACE/build/linux-arm64/ + + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: linux-arm64 + path: build/linux-arm64/ + retention-days: 1 diff --git a/.gitignore b/.gitignore index 0723504de..8ebbf6b63 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ libzkgroup*.so # Added by cargo /target +/bin