From 5fbdcef758aaf4dc6becd1cdbb2d43ac82c8c415 Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com> Date: Wed, 24 Jul 2024 10:39:00 +0530 Subject: [PATCH 1/6] added release for instances --- .github/workflows/release-instances.yml | 42 +++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/release-instances.yml diff --git a/.github/workflows/release-instances.yml b/.github/workflows/release-instances.yml new file mode 100644 index 000000000..03f88f4e6 --- /dev/null +++ b/.github/workflows/release-instances.yml @@ -0,0 +1,42 @@ +name: Deploy Components to Mainnet - Events and Infrastructure + +on: + pull_request: + push: + branches: [main] + +jobs: + deploy-widgets: + name: Deploy (or diff from PR) + runs-on: ubuntu-latest + strategy: + matrix: + target_account: + - environment: events-committee.near + dry_run_command: npm run dry-run:events + deploy_command: npm run deploy:events + - environment: infrastructure-committee.near + dry_run_command: npm run dry-run:infrastructure + deploy_command: npm run deploy:infrastructure + environment: ${{ matrix.target_account.environment }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + npm ci + curl --proto '=https' --tlsv1.2 -LsSf https://github.com/FroVolod/bos-cli-rs/releases/download/v0.3.6/bos-cli-installer.sh | sh + + - name: Deploy widgets + run: | + BRANCH=$(git rev-parse --abbrev-ref HEAD) + echo "On branch $BRANCH" + if [[ "$BRANCH" != "main" ]]; then + echo "Not on main branch, dry run" + echo "${{ matrix.target_account.environment }}" + echo "${{ matrix.target_account.deploy_command }} -- '${{ vars.NEAR_SOCIAL_ACCOUNT_ID }}' sign-as '${{ vars.NEAR_SOCIAL_ACCOUNT_ID }}' network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' send" + ${{ matrix.target_account.dry_run_command }} + else + ${{ matrix.target_account.deploy_command }} -- '${{ vars.NEAR_SOCIAL_ACCOUNT_ID }}' sign-as '${{ vars.NEAR_SOCIAL_ACCOUNT_ID }}' network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' send + fi From f9e42aa08f2a5353fbd45ca97d33f3e16fa22e13 Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com> Date: Wed, 24 Jul 2024 22:15:26 +0530 Subject: [PATCH 2/6] change to `dry-run-devhub.near` --- .github/workflows/release-instances.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/release-instances.yml b/.github/workflows/release-instances.yml index 03f88f4e6..44be2aa80 100644 --- a/.github/workflows/release-instances.yml +++ b/.github/workflows/release-instances.yml @@ -12,12 +12,9 @@ jobs: strategy: matrix: target_account: - - environment: events-committee.near + - environment: dry-run-devhub.near dry_run_command: npm run dry-run:events deploy_command: npm run deploy:events - - environment: infrastructure-committee.near - dry_run_command: npm run dry-run:infrastructure - deploy_command: npm run deploy:infrastructure environment: ${{ matrix.target_account.environment }} steps: - name: Checkout repository From 366b3568de80e2901cac1ed6c2a85da6b51d304c Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com> Date: Wed, 24 Jul 2024 22:20:18 +0530 Subject: [PATCH 3/6] add back infra and events --- .github/workflows/release-instances.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release-instances.yml b/.github/workflows/release-instances.yml index 44be2aa80..dfd6567d3 100644 --- a/.github/workflows/release-instances.yml +++ b/.github/workflows/release-instances.yml @@ -15,6 +15,12 @@ jobs: - environment: dry-run-devhub.near dry_run_command: npm run dry-run:events deploy_command: npm run deploy:events + - environment: events-committee.near + dry_run_command: npm run dry-run:events + deploy_command: npm run deploy:events + - environment: infrastructure-committee.near + dry_run_command: npm run dry-run:infrastructure + deploy_command: npm run deploy:infrastructure environment: ${{ matrix.target_account.environment }} steps: - name: Checkout repository From b0b78cf2cd7c8e70af73c98e15e232964e5f2660 Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com> Date: Wed, 24 Jul 2024 22:26:48 +0530 Subject: [PATCH 4/6] add separate dry-run yml --- .github/workflows/dry-run.yml | 28 +++++++++++++++++++++++++ .github/workflows/release-instances.yml | 19 ++--------------- 2 files changed, 30 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/dry-run.yml diff --git a/.github/workflows/dry-run.yml b/.github/workflows/dry-run.yml new file mode 100644 index 000000000..d9ecaa5ab --- /dev/null +++ b/.github/workflows/dry-run.yml @@ -0,0 +1,28 @@ +name: Dry-run Devhub, Events and Infrastructure + +on: + pull_request: + branches: [main] + +jobs: + deploy-widgets: + name: Diff from PR + runs-on: ubuntu-latest + strategy: + matrix: + target_account: + - dry_run_command: npm run dry-run:devhub + - dry_run_command: npm run dry-run:events + - dry_run_command: npm run dry-run:infrastructure + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + npm ci + curl --proto '=https' --tlsv1.2 -LsSf https://github.com/FroVolod/bos-cli-rs/releases/download/v0.3.6/bos-cli-installer.sh | sh + + - name: Deploy widgets + run: | + ${{ matrix.target_account.dry_run_command }} diff --git a/.github/workflows/release-instances.yml b/.github/workflows/release-instances.yml index dfd6567d3..e8f036c42 100644 --- a/.github/workflows/release-instances.yml +++ b/.github/workflows/release-instances.yml @@ -1,25 +1,19 @@ name: Deploy Components to Mainnet - Events and Infrastructure on: - pull_request: push: branches: [main] jobs: deploy-widgets: - name: Deploy (or diff from PR) + name: Deploy runs-on: ubuntu-latest strategy: matrix: target_account: - - environment: dry-run-devhub.near - dry_run_command: npm run dry-run:events - deploy_command: npm run deploy:events - environment: events-committee.near - dry_run_command: npm run dry-run:events deploy_command: npm run deploy:events - environment: infrastructure-committee.near - dry_run_command: npm run dry-run:infrastructure deploy_command: npm run deploy:infrastructure environment: ${{ matrix.target_account.environment }} steps: @@ -33,13 +27,4 @@ jobs: - name: Deploy widgets run: | - BRANCH=$(git rev-parse --abbrev-ref HEAD) - echo "On branch $BRANCH" - if [[ "$BRANCH" != "main" ]]; then - echo "Not on main branch, dry run" - echo "${{ matrix.target_account.environment }}" - echo "${{ matrix.target_account.deploy_command }} -- '${{ vars.NEAR_SOCIAL_ACCOUNT_ID }}' sign-as '${{ vars.NEAR_SOCIAL_ACCOUNT_ID }}' network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' send" - ${{ matrix.target_account.dry_run_command }} - else - ${{ matrix.target_account.deploy_command }} -- '${{ vars.NEAR_SOCIAL_ACCOUNT_ID }}' sign-as '${{ vars.NEAR_SOCIAL_ACCOUNT_ID }}' network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' send - fi + ${{ matrix.target_account.deploy_command }} -- '${{ vars.NEAR_SOCIAL_ACCOUNT_ID }}' sign-as '${{ vars.NEAR_SOCIAL_ACCOUNT_ID }}' network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' send From 392ac924716734fcc5d783c54dffaf3373725e05 Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com> Date: Wed, 24 Jul 2024 22:33:44 +0530 Subject: [PATCH 5/6] rename --- .github/workflows/dry-run.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dry-run.yml b/.github/workflows/dry-run.yml index d9ecaa5ab..5b650a06b 100644 --- a/.github/workflows/dry-run.yml +++ b/.github/workflows/dry-run.yml @@ -23,6 +23,6 @@ jobs: npm ci curl --proto '=https' --tlsv1.2 -LsSf https://github.com/FroVolod/bos-cli-rs/releases/download/v0.3.6/bos-cli-installer.sh | sh - - name: Deploy widgets + - name: Dry-run widgets run: | ${{ matrix.target_account.dry_run_command }} From 1a55d938e0149f5a3192c323f5962de2644b1804 Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com> Date: Wed, 24 Jul 2024 22:37:59 +0530 Subject: [PATCH 6/6] change from `send` to `display` --- .github/workflows/release-instances.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-instances.yml b/.github/workflows/release-instances.yml index e8f036c42..600e2b4c6 100644 --- a/.github/workflows/release-instances.yml +++ b/.github/workflows/release-instances.yml @@ -27,4 +27,4 @@ jobs: - name: Deploy widgets run: | - ${{ matrix.target_account.deploy_command }} -- '${{ vars.NEAR_SOCIAL_ACCOUNT_ID }}' sign-as '${{ vars.NEAR_SOCIAL_ACCOUNT_ID }}' network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' send + ${{ matrix.target_account.deploy_command }} -- '${{ vars.NEAR_SOCIAL_ACCOUNT_ID }}' sign-as '${{ vars.NEAR_SOCIAL_ACCOUNT_ID }}' network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' display