From ca8a6150c9f7ad6f5848735aa628543c24ff5304 Mon Sep 17 00:00:00 2001 From: farbanas Date: Mon, 16 Jan 2023 14:01:20 +0100 Subject: [PATCH 1/5] fix: moved the if step to the root of the job, removed unused workflows --- .github/workflows/network-explorer-api.yml | 56 ------------------- .github/workflows/nym-cli-publish.yml | 50 ----------------- .../workflows/nym-connect-publish-macos.yml | 8 +-- .../workflows/nym-connect-publish-ubuntu.yml | 7 +-- .../nym-connect-publish-windows10.yml | 8 +-- .github/workflows/nym-release-publish.yml | 10 +--- .../workflows/nym-wallet-publish-macos.yml | 8 +-- .../workflows/nym-wallet-publish-ubuntu.yml | 7 +-- .../nym-wallet-publish-windows10.yml | 8 +-- 9 files changed, 9 insertions(+), 153 deletions(-) delete mode 100644 .github/workflows/network-explorer-api.yml delete mode 100644 .github/workflows/nym-cli-publish.yml diff --git a/.github/workflows/network-explorer-api.yml b/.github/workflows/network-explorer-api.yml deleted file mode 100644 index 5c60038347..0000000000 --- a/.github/workflows/network-explorer-api.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: CI for Network Explorer API - -on: - workflow_dispatch: - release: - types: [created] - -env: - NETWORK: mainnet - -jobs: - publish-nym: - 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 - - - name: Check the release tag starts with `nym-explorer-api-` - if: startsWith(github.ref, 'refs/tags/nym-explorer-api-') == false && github.event_name != 'workflow_dispatch' - 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 5fd532c68b..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: - 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-` - if: startsWith(github.ref, 'refs/tags/nym-cli-') == false && github.event_name != 'workflow_dispatch' - 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 c327fe3af5..ba2acfe519 100644 --- a/.github/workflows/nym-connect-publish-macos.yml +++ b/.github/workflows/nym-connect-publish-macos.yml @@ -10,6 +10,7 @@ defaults: jobs: publish-tauri: + if: ${{ startsWith(github.ref, 'refs/tags/nym-connect-') && github.event_name == 'release' }} strategy: fail-fast: false matrix: @@ -19,13 +20,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Check the release tag starts with `nym-connect-` - if: startsWith(github.ref, 'refs/tags/nym-connect-') == false && github.event_name != 'workflow_dispatch' - uses: actions/github-script@v3 - with: - script: | - core.setFailed('Release tag did not start with nym-connect-...') - - name: Node v16 uses: actions/setup-node@v3 with: diff --git a/.github/workflows/nym-connect-publish-ubuntu.yml b/.github/workflows/nym-connect-publish-ubuntu.yml index a4eb77cae1..d7a1761baa 100644 --- a/.github/workflows/nym-connect-publish-ubuntu.yml +++ b/.github/workflows/nym-connect-publish-ubuntu.yml @@ -10,6 +10,7 @@ defaults: jobs: publish-tauri: + if: ${{ startsWith(github.ref, 'refs/tags/nym-connect-') && github.event_name == 'release' }} strategy: fail-fast: false matrix: @@ -23,12 +24,6 @@ jobs: run: > sudo apt-get update && sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev - - name: Check the release tag starts with `nym-connect-` - if: startsWith(github.ref, 'refs/tags/nym-connect-') == false && github.event_name != 'workflow_dispatch' - uses: actions/github-script@v3 - with: - script: | - core.setFailed('Release tag did not start with nym-connect-...') - name: Node v16 uses: actions/setup-node@v3 diff --git a/.github/workflows/nym-connect-publish-windows10.yml b/.github/workflows/nym-connect-publish-windows10.yml index f51349d8b4..599b6d27e4 100644 --- a/.github/workflows/nym-connect-publish-windows10.yml +++ b/.github/workflows/nym-connect-publish-windows10.yml @@ -10,6 +10,7 @@ defaults: jobs: publish-tauri: + if: ${{ startsWith(github.ref, 'refs/tags/nym-connect-') && github.event_name == 'release' }} strategy: fail-fast: false matrix: @@ -27,13 +28,6 @@ jobs: - uses: actions/checkout@v3 - - name: Check the release tag starts with `nym-connect-` - if: startsWith(github.ref, 'refs/tags/nym-connect-') == false && github.event_name != 'workflow_dispatch' - uses: actions/github-script@v3 - with: - script: | - core.setFailed('Release tag did not start with nym-connect-...') - - name: Import signing certificate env: WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }} diff --git a/.github/workflows/nym-release-publish.yml b/.github/workflows/nym-release-publish.yml index 979781652f..17b97ee450 100644 --- a/.github/workflows/nym-release-publish.yml +++ b/.github/workflows/nym-release-publish.yml @@ -16,6 +16,7 @@ env: jobs: publish-nym: + if: ${{ startsWith(github.ref, 'refs/tags/nym-binaries-') && github.event_name == 'release' }} strategy: fail-fast: false matrix: @@ -27,13 +28,6 @@ jobs: - 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 - - - name: Check the release tag starts with `nym-binaries-` - if: startsWith(github.ref, 'refs/tags/nym-binaries-') == false && github.event_name != 'workflow_dispatch' - uses: actions/github-script@v3 - with: - script: | - core.setFailed('Release tag did not start with nym-binaries-...') - name: Sets env vars for tokio if set in manual dispatch inputs run: | @@ -56,6 +50,7 @@ jobs: with: name: my-artifact path: | + target/release/explorer-api target/release/nym-client target/release/nym-gateway target/release/nym-mixnode @@ -71,6 +66,7 @@ jobs: if: github.event_name == 'release' with: files: | + target/release/explorer-api target/release/nym-client target/release/nym-gateway target/release/nym-mixnode diff --git a/.github/workflows/nym-wallet-publish-macos.yml b/.github/workflows/nym-wallet-publish-macos.yml index d7a3a88002..db55bc9754 100644 --- a/.github/workflows/nym-wallet-publish-macos.yml +++ b/.github/workflows/nym-wallet-publish-macos.yml @@ -10,6 +10,7 @@ defaults: jobs: publish-tauri: + if: ${{ startsWith(github.ref, 'refs/tags/nym-wallet-') && github.event_name == 'release' }} strategy: fail-fast: false matrix: @@ -19,13 +20,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Check the release tag starts with `nym-wallet-` - if: startsWith(github.ref, 'refs/tags/nym-wallet-') == false && github.event_name != 'workflow_dispatch' - uses: actions/github-script@v3 - with: - script: | - core.setFailed('Release tag did not start with nym-wallet-...') - - name: Node v16 uses: actions/setup-node@v3 with: diff --git a/.github/workflows/nym-wallet-publish-ubuntu.yml b/.github/workflows/nym-wallet-publish-ubuntu.yml index 04ff746851..06153a0c2c 100644 --- a/.github/workflows/nym-wallet-publish-ubuntu.yml +++ b/.github/workflows/nym-wallet-publish-ubuntu.yml @@ -9,6 +9,7 @@ defaults: jobs: publish-tauri: + if: ${{ startsWith(github.ref, 'refs/tags/nym-wallet-') && github.event_name == 'release' }} strategy: fail-fast: false matrix: @@ -22,12 +23,6 @@ jobs: run: > sudo apt-get update && sudo apt-get install -y webkit2gtk-4.0 - - name: Check the release tag starts with `nym-wallet-` - if: startsWith(github.ref, 'refs/tags/nym-wallet-') == false - uses: actions/github-script@v3 - with: - script: | - core.setFailed('Release tag did not start with nym-wallet-...') - name: Node v16 uses: actions/setup-node@v3 diff --git a/.github/workflows/nym-wallet-publish-windows10.yml b/.github/workflows/nym-wallet-publish-windows10.yml index cc257fcbc3..6f22820943 100644 --- a/.github/workflows/nym-wallet-publish-windows10.yml +++ b/.github/workflows/nym-wallet-publish-windows10.yml @@ -9,6 +9,7 @@ defaults: jobs: publish-tauri: + if: ${{ startsWith(github.ref, 'refs/tags/nym-wallet-') && github.event_name == 'release' }} strategy: fail-fast: false matrix: @@ -26,13 +27,6 @@ jobs: - uses: actions/checkout@v3 - - name: Check the release tag starts with `nym-wallet-` - if: startsWith(github.ref, 'refs/tags/nym-wallet-') == false - uses: actions/github-script@v3 - with: - script: | - core.setFailed('Release tag did not start with nym-wallet-...') - - name: Import signing certificate env: WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }} From 58d15429de9d0184799811f79c1c8253e5f1ab64 Mon Sep 17 00:00:00 2001 From: farbanas Date: Tue, 17 Jan 2023 13:05:35 +0100 Subject: [PATCH 2/5] feat: change Github hosted ubuntu-20.04 runners for our own custom-runner-linux --- .github/workflows/nym-connect-publish-ubuntu.yml | 2 +- .github/workflows/nym-release-publish.yml | 2 +- .github/workflows/nym-wallet-publish-ubuntu.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nym-connect-publish-ubuntu.yml b/.github/workflows/nym-connect-publish-ubuntu.yml index d7a1761baa..1c52d9c209 100644 --- a/.github/workflows/nym-connect-publish-ubuntu.yml +++ b/.github/workflows/nym-connect-publish-ubuntu.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - platform: [ubuntu-20.04] + platform: [custom-runner-linux] runs-on: ${{ matrix.platform }} steps: diff --git a/.github/workflows/nym-release-publish.yml b/.github/workflows/nym-release-publish.yml index 17b97ee450..22143a21aa 100644 --- a/.github/workflows/nym-release-publish.yml +++ b/.github/workflows/nym-release-publish.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - platform: [ubuntu-20.04] + platform: [custom-runner-linux] runs-on: ${{ matrix.platform }} steps: diff --git a/.github/workflows/nym-wallet-publish-ubuntu.yml b/.github/workflows/nym-wallet-publish-ubuntu.yml index 06153a0c2c..45ea86cb6b 100644 --- a/.github/workflows/nym-wallet-publish-ubuntu.yml +++ b/.github/workflows/nym-wallet-publish-ubuntu.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - platform: [ubuntu-20.04] + platform: [custom-runner-linux] runs-on: ${{ matrix.platform }} steps: From df4587be62d2af1a717c3b0c39c3b6d9036284e8 Mon Sep 17 00:00:00 2001 From: farbanas Date: Tue, 17 Jan 2023 15:47:46 +0100 Subject: [PATCH 3/5] chore: whitespace --- .github/workflows/nym-connect-publish-ubuntu.yml | 1 + .github/workflows/nym-wallet-publish-ubuntu.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/nym-connect-publish-ubuntu.yml b/.github/workflows/nym-connect-publish-ubuntu.yml index 1c52d9c209..24849e2dec 100644 --- a/.github/workflows/nym-connect-publish-ubuntu.yml +++ b/.github/workflows/nym-connect-publish-ubuntu.yml @@ -29,6 +29,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: 16 + - name: Install Rust stable uses: actions-rs/toolchain@v1 with: diff --git a/.github/workflows/nym-wallet-publish-ubuntu.yml b/.github/workflows/nym-wallet-publish-ubuntu.yml index 45ea86cb6b..745a10e696 100644 --- a/.github/workflows/nym-wallet-publish-ubuntu.yml +++ b/.github/workflows/nym-wallet-publish-ubuntu.yml @@ -28,6 +28,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: 16 + - name: Install Rust stable uses: actions-rs/toolchain@v1 with: From 95b95b289270f42e690b96ffb7cccf26019d19ee Mon Sep 17 00:00:00 2001 From: farbanas Date: Tue, 17 Jan 2023 16:24:03 +0100 Subject: [PATCH 4/5] fix: contracts build shouldn't fail on wrong tag --- .github/workflows/contracts-build.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/contracts-build.yml b/.github/workflows/contracts-build.yml index 9ecc6b49d9..e75b893f31 100644 --- a/.github/workflows/contracts-build.yml +++ b/.github/workflows/contracts-build.yml @@ -6,17 +6,11 @@ on: jobs: build: + if: ${{ startsWith(github.ref, 'refs/tags/nym-contracts-') && github.event_name == 'release' }} runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - - name: Check the release tag starts with `nym-contracts-` - if: startsWith(github.ref, 'refs/tags/nym-contracts-') == false && github.event_name != 'workflow_dispatch' - uses: actions/github-script@v3 - with: - script: | - core.setFailed('Release tag did not start with nym-contracts-...') - - name: Install Rust stable uses: actions-rs/toolchain@v1 with: From e849cc065aa4e8c345722458d7128024d48f911a Mon Sep 17 00:00:00 2001 From: farbanas Date: Tue, 17 Jan 2023 16:43:36 +0100 Subject: [PATCH 5/5] move contracts build to our custom runner --- .github/workflows/contracts-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/contracts-build.yml b/.github/workflows/contracts-build.yml index e75b893f31..efe1230175 100644 --- a/.github/workflows/contracts-build.yml +++ b/.github/workflows/contracts-build.yml @@ -7,7 +7,7 @@ on: jobs: build: if: ${{ startsWith(github.ref, 'refs/tags/nym-contracts-') && github.event_name == 'release' }} - runs-on: ubuntu-20.04 + runs-on: [self-hosted, custom-runner-linux] steps: - uses: actions/checkout@v2