Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
pyramation committed Oct 10, 2024
1 parent 2863c15 commit d6d1c90
Show file tree
Hide file tree
Showing 9 changed files with 189 additions and 73 deletions.
19 changes: 6 additions & 13 deletions .github/workflows/codegen-types-dryrun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,16 @@ jobs:

- name: Update Git Submodules 🔄
run: |
make update-cosmos # Fixed typo here
make update-cosmos
- name: Install Dependencies 🧶
- name: V2 Operations 🛠
run: |
cd v2
pushd v2
yarn install
yarn symlink
- name: Build Project 🏗️
run: |
cd v2
yarn build
yarn symlink
- name: Types Generation 🛠
run: |
cd v2
# Generate types and interfaces
pushd workflows/generate-types
yarn generate:types
Expand All @@ -59,9 +51,10 @@ jobs:
yarn build
popd
cd ..
popd
# check changes
- name: Check for Changes
run: |
git add .
if ! git diff --staged --quiet; then
echo "GIT_RESULT=Changes to commit and/or publish." >> $GITHUB_ENV
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/codegen-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,14 @@ jobs:
run: |
make update-cosmos
- name: Install Dependencies 🧶
- name: V2 Operations 🛠
run: |
cd v2
pushd v2
yarn install
yarn symlink
- name: Build Project 🏗️
run: |
cd v2
yarn build
yarn symlink
- name: Types Generation 🛠
run: |
cd v2
# Generate types and interfaces
pushd workflows/generate-types
yarn generate:types
Expand All @@ -59,9 +51,10 @@ jobs:
yarn build
popd
cd ..
popd
# Stage all changes and commit if there are any changes
- name: Commit and Push Changes
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git add .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Codegen Main Dry Run
name: Codegen Main V1 Dry Run

on:
workflow_dispatch:
Expand All @@ -22,23 +22,18 @@ jobs:
run: |
make update-cosmos
- name: Install Dependencies 🧶
- name: V1 Operations 🛠
run: |
cd v1
pushd v1
yarn install
yarn symlink
- name: Build Project 🏗️
run: |
cd v1
yarn build
yarn symlink
yarn codegen
popd
- name: Code Generation 🛠
- name: Check for Changes
run: |
cd v1
yarn codegen
cd ..
git add .
if ! git diff --staged --quiet; then
echo "GIT_RESULT=Changes detected." >> $GITHUB_ENV
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Codegen Main
name: Codegen Main V1

on:
schedule:
Expand Down Expand Up @@ -26,22 +26,14 @@ jobs:
run: |
make update-cosmos
- name: Install Dependencies 🧶
- name: V1 Operations 🛠
run: |
cd v1
pushd v1
yarn install
yarn symlink
- name: Build Project 🏗️
run: |
cd v1
yarn build
yarn symlink
- name: Code Generation 🛠
run: |
cd v1
# Code generation and build for various packages
pushd packages/chain-registry
yarn codegen
Expand All @@ -60,9 +52,10 @@ jobs:
yarn codegen
popd
cd ..
popd
# Stage all changes and commit if there are any changes
- name: Commit Changes
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git add .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Lerna Publish Minor
name: Lerna Publish Minor V1

on:
workflow_run:
workflows: ["Codegen Main V1"]
types:
- completed

workflow_dispatch:

jobs:
Expand Down Expand Up @@ -29,15 +34,6 @@ jobs:
cd v1
yarn
lerna publish minor --force-publish=chain-registry --no-verify-access --yes
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_SECRET}}
GH_TOKEN: ${{ secrets.GH_LERNA_PUBLISH_TOKEN }}

- name: Publish v2 Minor Version
run: |
cd v2
yarn
lerna publish --force-publish=@chain-registry/v2 --no-verify-access --yes
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_SECRET}}
GH_TOKEN: ${{ secrets.GH_LERNA_PUBLISH_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/v1-lerna-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Lerna Publish V1

on:
workflow_run:
workflows: ["Codegen Main V1"]
types:
- completed

workflow_dispatch:

jobs:
publish-npm:
name: Publish V1 Version
runs-on: ubuntu-latest
steps:
- name: Checkout Repository 🛎️
uses: actions/checkout@v4
with:
submodules: "true"

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: https://registry.npmjs.org/

- name: Configure Git
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor}}@users.noreply.github.com"
- name: Publish V1 Version 🚀
run: |
pushd v1
yarn
yarn lerna publish --force-publish=chain-registry --no-verify-access --yes
popd
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_SECRET}}
GH_TOKEN: ${{ secrets.GH_LERNA_PUBLISH_TOKEN }}
75 changes: 75 additions & 0 deletions .github/workflows/v2-codegen-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Codegen Main V2

on:
schedule:
# Runs every day at 1:00 AM UTC
- cron: "0 1 * * *"

workflow_dispatch:

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository 📥
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Setup Node.js 🌐
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: https://registry.npmjs.org/

- name: Update Git Submodules 🔄
run: |
make update-cosmos
- name: V2 Operations 🛠
run: |
pushd v2
yarn install
yarn symlink
yarn build
yarn symlink
# Code generation and build for various packages
pushd packages/chain-registry
yarn codegen
yarn build
popd
# pushd packages/assets
# yarn codegen
# popd
# pushd packages/osmosis
# yarn codegen
# popd
# pushd packages/juno
# yarn codegen
# popd
popd
- name: Commit Changes
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git add .
if ! git diff --staged --quiet; then
git commit -am "build 🛠 build-$(date +%Y%m%d-%H%M%S)"
git push origin main
echo "GIT_RESULT=Published." >> $GITHUB_ENV
else
echo "GIT_RESULT=No changes to commit." >> $GITHUB_ENV
fi
- name: Git Ops
run: |
echo $GIT_RESULT
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_SECRET}}
GH_TOKEN: ${{ secrets.GH_LERNA_PUBLISH_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Lerna Publish
name: Lerna Publish Minor V2

on:
workflow_run:
workflows: ["Codegen Main"]
workflows: ["Codegen Main V2"]
types:
- completed

workflow_dispatch:

jobs:
publish-npm:
name: Publish Versions
name: Publish Minor Versions
runs-on: ubuntu-latest
steps:
- name: Checkout Repository 🛎️
Expand All @@ -29,20 +29,11 @@ jobs:
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor}}@users.noreply.github.com"
- name: Publish v1 Version
run: |
cd v1
yarn
lerna publish --force-publish=chain-registry --no-verify-access --yes
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_SECRET}}
GH_TOKEN: ${{ secrets.GH_LERNA_PUBLISH_TOKEN }}

- name: Publish v2 Version
- name: Publish V2 Minor Version
run: |
cd v2
yarn
lerna publish --force-publish=@chain-registry/v2 --no-verify-access --yes
lerna publish minor --force-publish=@chain-registry/v2 --no-verify-access --yes
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_SECRET}}
GH_TOKEN: ${{ secrets.GH_LERNA_PUBLISH_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/v2-lerna-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Lerna Publish V2

on:
workflow_run:
workflows: ["Codegen Main V2"]
types:
- completed

workflow_dispatch:

jobs:
publish-npm:
name: Publish V2 Version
runs-on: ubuntu-latest
steps:
- name: Checkout Repository 🛎️
uses: actions/checkout@v4
with:
submodules: "true"

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: https://registry.npmjs.org/

- name: Configure Git
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor}}@users.noreply.github.com"
- name: Publish V2 Version 🚀
run: |
pushd v2
yarn
yarn lerna publish --force-publish=@chain-registry/v2 --no-verify-access --yes
popd
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_SECRET}}
GH_TOKEN: ${{ secrets.GH_LERNA_PUBLISH_TOKEN }}

0 comments on commit d6d1c90

Please sign in to comment.