Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
chore: break out to separate workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed Dec 6, 2023
1 parent db51b38 commit fe8f052
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 51 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/evolve-state.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Evolve Contract State

on:
workflow_dispatch:
inputs:
evolve-state-tx-id:
description: 'Confirm the source code transaction ID you are running evolve state against.'
required: false
type: string
default: null

jobs:
evolve-state:
if: github.event.inputs.evolve-state-tx-id != null
runs-on: ubuntu-latest
environment: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: 'yarn'
- name: Validate Input
run: |
SOURCE_CODE_TX_ID=$(curl https://api.arns.app/v1/contract/${{ vars.ARNS_CONTRACT_TX_ID }} | jq -r '.state.evolve')
if [ -z "${{ github.event.inputs.evolve-state-tx-id }}" ]; then
echo "No evolve-state-tx-id provided. Exiting."
exit 1
fi
if [ "${{ github.event.inputs.evolve-state-tx-id }}" = "$SOURCE_CODE_TX_ID" ]; then
echo "The evolve-state-tx-id the current source code TX ID of the contract. Evolving state..."
else
echo "The evolve-state-tx-id does not match the current source code TX ID of the contract. Exiting."
exit 1
fi
- run: yarn install
- run: yarn evolve:state
env:
ARNS_CONTRACT_TX_ID: ${{ vars.ARNS_CONTRACT_TX_ID }}
JWK: ${{ secrets.JWK }}
52 changes: 1 addition & 51 deletions .github/workflows/evolve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ name: Build / Test / Evolve Contract

on:
workflow_dispatch:
inputs:
evolve-state-tx-id:
description: 'Confirm the source code transaction ID you are running evolve state against.'
required: false
type: string
default: null
push:
branches:
- develop
Expand All @@ -18,21 +12,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
environment: ${{ github.ref_name }}
strategy:
matrix:
step: ['format:check', 'lint:check', 'build', 'test']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: 'yarn'
- run: yarn install
- run: yarn ${{ matrix.step }}
env:
ARNS_CONTRACT_TX_ID: ${{ vars.ARNS_CONTRACT_TX_ID }}
uses: ./.github/workflows/build_and_test.yml

evolve:
runs-on: ubuntu-latest
Expand All @@ -56,33 +36,3 @@ jobs:
- run: |
git tag "${{ steps.evolve.outputs.srcTxId }}"
git push --tags
evolve-state:
if: github.event.inputs.evolve-state-tx-id != null
runs-on: ubuntu-latest
environment: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: 'yarn'
- name: Validate Input
run: |
SOURCE_CODE_TX_ID=$(curl https://api.arns.app/v1/contract/${{ vars.ARNS_CONTRACT_TX_ID }} | jq -r '.state.evolve')
if [ -z "${{ github.event.inputs.evolve-state-tx-id }}" ]; then
echo "No evolve-state-tx-id provided. Exiting."
exit 1
fi
if [ "${{ github.event.inputs.evolve-state-tx-id }}" = "$SOURCE_CODE_TX_ID" ]; then
echo "The evolve-state-tx-id the current source code TX ID of the contract. Evolving state..."
else
echo "The evolve-state-tx-id does not match the current source code TX ID of the contract. Exiting."
exit 1
fi
- run: yarn install
- run: yarn evolve:state
env:
ARNS_CONTRACT_TX_ID: ${{ vars.ARNS_CONTRACT_TX_ID }}
JWK: ${{ secrets.JWK }}

0 comments on commit fe8f052

Please sign in to comment.