From bc5bb271d874a6cf4270e87ad03b4fcb86ed7240 Mon Sep 17 00:00:00 2001 From: farbanas Date: Tue, 28 Feb 2023 17:26:39 +0100 Subject: [PATCH] feat: remove unused workflows, update a couple of if conditions in github workflows and add the command for optimizing contract sizes to Makefile --- .github/workflows/contracts-build.yml | 5 +- .github/workflows/network-explorer-api.yml | 57 ------------------- .github/workflows/nym-cli-publish.yml | 50 ---------------- .../workflows/nym-connect-publish-macos.yml | 2 +- .../workflows/nym-connect-publish-ubuntu.yml | 2 +- .github/workflows/nym-release-publish.yml | 2 +- .../workflows/nym-wallet-publish-macos.yml | 2 +- .../workflows/nym-wallet-publish-ubuntu.yml | 2 +- Makefile | 2 + 9 files changed, 11 insertions(+), 113 deletions(-) delete mode 100644 .github/workflows/network-explorer-api.yml delete mode 100644 .github/workflows/nym-cli-publish.yml diff --git a/.github/workflows/contracts-build.yml b/.github/workflows/contracts-build.yml index efe1230175..839a8804e6 100644 --- a/.github/workflows/contracts-build.yml +++ b/.github/workflows/contracts-build.yml @@ -6,7 +6,7 @@ on: jobs: build: - if: ${{ startsWith(github.ref, 'refs/tags/nym-contracts-') && github.event_name == 'release' }} + if: ${{ (startsWith(github.ref, 'refs/tags/nym-contracts-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }} runs-on: [self-hosted, custom-runner-linux] steps: - uses: actions/checkout@v2 @@ -19,6 +19,9 @@ jobs: override: true components: rustfmt, clippy + - name: Install wasm-opt + run: cargo install wasm-opt + - name: Build release contracts run: make wasm diff --git a/.github/workflows/network-explorer-api.yml b/.github/workflows/network-explorer-api.yml deleted file mode 100644 index 6a23d5baf9..0000000000 --- a/.github/workflows/network-explorer-api.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: CI for Network Explorer API - -on: - workflow_dispatch: - release: - types: [created] - -env: - NETWORK: mainnet - -jobs: - publish-nym: - if: ${{ startsWith(github.ref, 'refs/tags/nym-explorer-api-') && (github.event_name == 'release' || github.event_name == 'workflow_dispatch') }} - strategy: - fail-fast: false - matrix: - platform: [ubuntu-20.04] - - runs-on: ${{ matrix.platform }} - steps: - - uses: actions/checkout@v3 - - - name: Install Dependencies (Linux) - run: sudo apt-get update && sudo apt-get -y install libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libudev-dev squashfs-tools - continue-on-error: true - - - name: Check the release tag starts with `nym-explorer-api-` - uses: actions/github-script@v3 - with: - script: | - core.setFailed('Release tag did not start with nym-explorer-api-...') - - - name: Install Rust stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - - name: Build all explorer-api - uses: actions-rs/cargo@v1 - with: - command: build - args: --manifest-path explorer-api/Cargo.toml --workspace --release - - - name: Upload Artifact - uses: actions/upload-artifact@v3 - with: - name: my-artifact - path: | - target/release/explorer-api - retention-days: 30 - - - name: Upload to release based on tag name - uses: softprops/action-gh-release@v1 - if: github.event_name == 'release' - with: - files: | - target/release/explorer-api diff --git a/.github/workflows/nym-cli-publish.yml b/.github/workflows/nym-cli-publish.yml deleted file mode 100644 index dab51eea24..0000000000 --- a/.github/workflows/nym-cli-publish.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Publish Nym CLI binaries - -on: - workflow_dispatch: - release: - types: [created] - -env: - NETWORK: mainnet - -jobs: - publish-nym-cli: - if: ${{ startsWith(github.ref, 'refs/tags/nym-cli-') && (github.event_name == 'release' || github.event_name == 'workflow_dispatch') }} - strategy: - fail-fast: false - matrix: - platform: [ubuntu-20.04, windows-latest, macos-latest] - - runs-on: ${{ matrix.platform }} - steps: - - uses: actions/checkout@v3 - - - name: Check the release tag starts with `nym-cli-` - uses: actions/github-script@v3 - with: - script: | - core.setFailed('Release tag did not start with nym-cli-...') - - - name: Install Rust stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - - name: Build binary - run: make build-nym-cli - - - name: Upload Artifact - uses: actions/upload-artifact@v3 - with: - name: nym-cli-${{ matrix.platform }} - path: | - target/release/nym-cli* - retention-days: 30 - - - name: Upload to release based on tag name - uses: softprops/action-gh-release@v1 - if: github.event_name == 'release' - with: - files: | - target/release/nym-cli diff --git a/.github/workflows/nym-connect-publish-macos.yml b/.github/workflows/nym-connect-publish-macos.yml index faff21a30c..0c9b33e416 100644 --- a/.github/workflows/nym-connect-publish-macos.yml +++ b/.github/workflows/nym-connect-publish-macos.yml @@ -10,7 +10,7 @@ defaults: jobs: publish-tauri: - if: ${{ startsWith(github.ref, 'refs/tags/nym-connect-') && github.event_name == 'release' }} + if: ${{ (startsWith(github.ref, 'refs/tags/nym-connect-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }} strategy: fail-fast: false matrix: diff --git a/.github/workflows/nym-connect-publish-ubuntu.yml b/.github/workflows/nym-connect-publish-ubuntu.yml index fd36ca4909..473371c9e0 100644 --- a/.github/workflows/nym-connect-publish-ubuntu.yml +++ b/.github/workflows/nym-connect-publish-ubuntu.yml @@ -10,7 +10,7 @@ defaults: jobs: publish-tauri: - if: ${{ startsWith(github.ref, 'refs/tags/nym-connect-') && github.event_name == 'release' }} + if: ${{ (startsWith(github.ref, 'refs/tags/nym-connect-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }} strategy: fail-fast: false matrix: diff --git a/.github/workflows/nym-release-publish.yml b/.github/workflows/nym-release-publish.yml index 09b4caa9b8..a73eabfcb3 100644 --- a/.github/workflows/nym-release-publish.yml +++ b/.github/workflows/nym-release-publish.yml @@ -16,7 +16,7 @@ env: jobs: publish-nym: - if: ${{ startsWith(github.ref, 'refs/tags/nym-binaries-') && github.event_name == 'release' }} + if: ${{ (startsWith(github.ref, 'refs/tags/nym-binaries-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }} strategy: fail-fast: false matrix: diff --git a/.github/workflows/nym-wallet-publish-macos.yml b/.github/workflows/nym-wallet-publish-macos.yml index db55bc9754..d3ef82759e 100644 --- a/.github/workflows/nym-wallet-publish-macos.yml +++ b/.github/workflows/nym-wallet-publish-macos.yml @@ -10,7 +10,7 @@ defaults: jobs: publish-tauri: - if: ${{ startsWith(github.ref, 'refs/tags/nym-wallet-') && github.event_name == 'release' }} + if: ${{ (startsWith(github.ref, 'refs/tags/nym-wallet-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }} strategy: fail-fast: false matrix: diff --git a/.github/workflows/nym-wallet-publish-ubuntu.yml b/.github/workflows/nym-wallet-publish-ubuntu.yml index c27a9f0233..2b5a55c37a 100644 --- a/.github/workflows/nym-wallet-publish-ubuntu.yml +++ b/.github/workflows/nym-wallet-publish-ubuntu.yml @@ -9,7 +9,7 @@ defaults: jobs: publish-tauri: - if: ${{ startsWith(github.ref, 'refs/tags/nym-wallet-') && github.event_name == 'release' }} + if: ${{ (startsWith(github.ref, 'refs/tags/nym-wallet-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }} strategy: fail-fast: false matrix: diff --git a/Makefile b/Makefile index a13100f7ba..a3a51f4e6b 100644 --- a/Makefile +++ b/Makefile @@ -126,6 +126,8 @@ fmt-wasm-client: wasm: RUSTFLAGS='-C link-arg=-s' cargo build --manifest-path contracts/Cargo.toml --release --target wasm32-unknown-unknown + wasm-opt -Os contracts/target/wasm32-unknown-unknown/release/vesting_contract.wasm -o contracts/target/wasm32-unknown-unknown/release/vesting_contract.wasm + wasm-opt -Os contracts/target/wasm32-unknown-unknown/release/mixnet_contract.wasm -o contracts/target/wasm32-unknown-unknown/release/mixnet_contract.wasm mixnet-opt: wasm cd contracts/mixnet && make opt