Skip to content

Commit

Permalink
ci: consolidate proposer workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
diegofigs committed Nov 29, 2024
1 parent 09fd94d commit 4673367
Showing 1 changed file with 110 additions and 0 deletions.
110 changes: 110 additions & 0 deletions .github/workflows/propose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Proposer Workflows

permissions:
contents: write

on:
pull_request:

jobs:
propose:
if: startsWith(github.head_ref, 'proposer/')
runs-on: ubuntu-latest
steps:
# Checkout the repository
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

# Set up Node.js
- uses: actions/setup-node@v4
with:
node-version: 18

# Cache dependencies
- name: Cache node_modules
id: cache-deps
uses: actions/cache@v3
with:
path: |
node_modules
~/.cache/yarn
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
# Install dependencies if cache miss
- name: Install Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
cp .env.example .env
yarn install --frozen-lockfile
# Prepare environment
- run: cp .env.example .env

- name: Propose (set-allocation)
if: contains(github.head_ref, 'set-allocation')
env:
SAFE_PROPOSER_PRIVATE_KEY: ${{ secrets.SAFE_OPS_PROPOSER }}
AURORA_API_KEY: ${{ secrets.AURORA_API_KEY }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
run: yarn hardhat run scripts/ops/proposerSetAllocation.ts --network aurora

- name: Propose (set-rewarder)
if: contains(github.head_ref, 'set-rewarder')
env:
SAFE_PROPOSER_PRIVATE_KEY: ${{ secrets.SAFE_OPS_PROPOSER }}
AURORA_API_KEY: ${{ secrets.AURORA_API_KEY }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
run: yarn hardhat run scripts/ops/proposerRewarderTokensPerBlock.ts --network aurora

- name: Propose (set-complexrewarder)
if: contains(github.head_ref, 'set-complexrewarder')
env:
SAFE_PROPOSER_PRIVATE_KEY: ${{ secrets.SAFE_OPS_PROPOSER }}
AURORA_API_KEY: ${{ secrets.AURORA_API_KEY }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
run: yarn hardhat run scripts/ops/proposerComplexNRewarderTokensPerBlock.ts --network aurora

- name: Propose (add-rewarder)
if: contains(github.head_ref, 'add-rewarder')
env:
SAFE_SIGNER_MNEMONIC: ${{ secrets.SAFE_SIGNER_MNEMONIC }}
AURORA_API_KEY: ${{ secrets.AURORA_API_KEY }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
run: yarn hardhat run scripts/ops/safeDeployRewarder.ts --network aurora

- name: Propose (add-complexrewarder)
if: contains(github.head_ref, 'add-complexrewarder')
env:
SAFE_SIGNER_MNEMONIC: ${{ secrets.SAFE_SIGNER_MNEMONIC }}
AURORA_API_KEY: ${{ secrets.AURORA_API_KEY }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
run: yarn hardhat run scripts/ops/safeDeployComplexNRewarder.ts --network aurora

- name: Propose (set-emissions)
if: contains(github.head_ref, 'set-emissions')
env:
SAFE_PROPOSER_PRIVATE_KEY: ${{ secrets.SAFE_DAO_PROPOSER }}
AURORA_API_KEY: ${{ secrets.AURORA_API_KEY }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
run: yarn hardhat run scripts/ops/proposerUpdateTriPerBlock.ts --network aurora

- name: Commit changes
if: |
steps.propose_pool_allocation.outcome == 'success' ||
steps.propose_rewarder_tokens_per_block.outcome == 'success' ||
steps.propose_complex_n_rewarder_tokens_per_block.outcome == 'success' ||
steps.propose_new_rewarder.outcome == 'success' ||
steps.propose_new_complex_n_rewarder.outcome == 'success'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: |
Updated configuration files after proposing transactions
commit_options: "--no-verify"
file_pattern: |
allocationConfig.json
rewarderTokensPerBlock.json
complexNRewarderTokensPerBlock.json
rewarderConfigs.json

0 comments on commit 4673367

Please sign in to comment.