forked from paritytech/metadata-portal
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added dev chains CI #148
Open
pgolovkin
wants to merge
5
commits into
master
Choose a base branch
from
feature/add_dev_chains_ci
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Added dev chains CI #148
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Deploy | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: 🛎 Checkout | ||
id: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- uses: ./.github/workflows/rust-install | ||
|
||
- name: ⚙ Run verifier | ||
id: verify | ||
run: make verifier | ||
|
||
- name: ⚙ Run collector | ||
id: collect | ||
run: | | ||
cargo run --release -- -c=config.toml collect | ||
exit_code=$? | ||
if [ $exit_code -eq 12 ] | ||
then | ||
echo "::set-output name=redeploy::true" | ||
exit 0 | ||
fi | ||
echo "::set-output name=redeploy::false" | ||
exit $exit_code | ||
shell: bash {0} | ||
|
||
- name: ⚙ Run collector dev | ||
id: collect | ||
run: | | ||
cargo run --release -- -c=config_dev.toml collect | ||
exit_code=$? | ||
if [ $exit_code -eq 12 ] | ||
then | ||
echo "::set-output name=redeploy::true" | ||
exit 0 | ||
fi | ||
echo "::set-output name=redeploy::false" | ||
exit $exit_code | ||
shell: bash {0} | ||
|
||
- uses: ./.github/workflows/deploy | ||
id: deploy | ||
if: success() || failure() && (steps.collect.outcome == 'failure') | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
name: Check updates&sign for dev chains | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
BRANCH_PREFIX: updated-codes | ||
NOTIFY_MATRIX: false | ||
NOTIFY_TELEGRAM: true | ||
GITHUB_WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
pgolovkin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 🛎 Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: 🔧 Install rust dependencies | ||
uses: ./.github/workflows/rust-install | ||
|
||
- name: Try to checkout exising PR branch | ||
id: checkout-pr | ||
run: | | ||
SIGN_ME_BRANCH=$(git branch -r --list "origin/$BRANCH_PREFIX-*" --sort=-refname | head -n 1) | ||
if [ -z "$SIGN_ME_BRANCH" ] | ||
then | ||
switched="false" | ||
else | ||
git checkout --track $SIGN_ME_BRANCH | ||
switched="true" | ||
fi | ||
echo "::set-output name=switched::$switched" | ||
|
||
- name: ⚙ Build metadata-cli | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release | ||
|
||
- name: ⚙ Update QRs from RPC nodes | ||
id: update-nodes | ||
run: | | ||
cargo run --release -- -c=config_dev.toml update --sign --signing-key ${{secrets.SIGNING_KEY}} --source node | ||
exit_code=$? | ||
if [ $exit_code -eq 12 ] | ||
then | ||
echo "::set-output name=chainsSkipped::true" | ||
exit 0 | ||
fi | ||
echo "::set-output name=chainsSkipped::false" | ||
exit $exit_code | ||
shell: bash {0} | ||
|
||
- name: ⚙ Update QRs from GitHub releases | ||
run: | | ||
cargo run --release -- -c=config_dev.toml update --sign --signing-key ${{secrets.SIGNING_KEY}} --source github | ||
|
||
- name: ⚙ Run collector | ||
id: collect | ||
run: | | ||
cargo run --release -- -c=config_dev.toml collect | ||
exit_code=$? | ||
if [ $exit_code -eq 12 ] | ||
then | ||
echo "::set-output name=chainsSkipped::true" | ||
exit 0 | ||
fi | ||
echo "::set-output name=chainsSkipped::false" | ||
exit $exit_code | ||
shell: bash {0} | ||
|
||
- name: ⚙ Run cleaner | ||
if: ${{ steps.collect.outputs.chainsSkipped == 'false' }} | ||
id: cleaner | ||
run: cargo run --release -- -c=config_dev.toml clean | ||
|
||
- name: 📌 Commit changes if PR exists | ||
if: ${{ steps.checkout-pr.outputs.switched == 'true' }} | ||
uses: ./.github/workflows/commit-changes | ||
with: | ||
message: 'metadata update&sign' | ||
|
||
- name: New PR branch | ||
if: ${{ steps.checkout-pr.outputs.switched == 'false' }} | ||
id: new-branch | ||
run: | | ||
NAME="$BRANCH_PREFIX-$(date '+%Y-%m-%d')" | ||
echo "::set-output name=name::$NAME" | ||
|
||
- name: Create Pull Request if not exist | ||
if: ${{ steps.checkout-pr.outputs.switched == 'false' }} | ||
id: cpr | ||
uses: peter-evans/create-pull-request@f22a7da129c901513876a2380e2dae9f8e145330 | ||
with: | ||
commit-message: add updated QR codes | ||
branch: ${{ steps.new-branch.outputs.name }} | ||
delete-branch: true | ||
base: master | ||
title: '[Automated] Review new metadata QRs' | ||
body: | | ||
Updated metadata QR codes | ||
reviewers: "stepanLav,pgolovkin,tuul-wq,Asmadek" | ||
draft: false | ||
|
||
check-deployment: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 🛎 Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: 🔧 Install rust dependencies | ||
uses: ./.github/workflows/rust-install | ||
|
||
- name: ⚙ Check existing deployment | ||
id: check-deployment | ||
run: | | ||
cargo run --release -- -c=config_dev.toml check-deployment | ||
exit_code=$? | ||
if [ $exit_code -eq 12 ] | ||
then | ||
echo "::set-output name=redeploy::true" | ||
exit 0 | ||
fi | ||
echo "::set-output name=redeploy::false" | ||
exit $exit_code | ||
shell: bash {0} | ||
|
||
- name: ⚙ Run collector | ||
id: collect | ||
if: ${{ steps.check-deployment.outputs.redeploy == 'true' }} | ||
run: | | ||
cargo run --release -- -c=config_dev.toml collect | ||
exit_code=$? | ||
if [ $exit_code -eq 12 ] | ||
then | ||
exit 0 | ||
fi | ||
exit $exit_code | ||
shell: bash {0} | ||
|
||
- if: ${{ steps.check-deployment.outputs.redeploy == 'true' }} | ||
uses: ./.github/workflows/deploy | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like it is the same action as for the main deployment
Isn't this version going to overlay the main version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, the action is the same. It just builds the NPM package and updates the gh-pages. NPM is the same for dev and prod builds.
Thank you for noticing it. I missed it and it may cause a big problem. Lucky that deploy isn't environment dependent.