Skip to content

Commit

Permalink
chore: merge v0.6.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbinth authored Nov 6, 2024
2 parents 2cdabad + f05a40c commit 6bb7d51
Show file tree
Hide file tree
Showing 104 changed files with 3,460 additions and 2,981 deletions.
77 changes: 77 additions & 0 deletions .github/actions/ssm_execute/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: 'execute_ec2'
description: 'Execute commands on EC2 instance'
inputs:
instance_id:
required: true
description: "Instance ID to execute ssm commands on"
command:
required: true
description: "Set of commands to execute on the instance"
check_timeout:
default: "10"
description: "Timeout to check for output. After n seconds the output is printed from shell."
total_timeout:
description: "Total timeout for the command execution"
default: "1800"

outputs:
cmd_result:
description: "Output from executed command"
value: ${{ steps.poll_output.outputs.cmd_result }}

runs:
using: "composite"
steps:
- name: Execute_Command
id: execute_cmd
shell: bash
run: |
formatted_command=$(echo "${{ inputs.command }}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' -e 's/\n/ && /g')
echo "Executing command: $formatted_command"
COMMAND_ID=$(aws ssm send-command \
--instance-ids ${{ inputs.instance_id }} \
--document-name "AWS-RunShellScript" \
--parameters '{"commands":["'"$formatted_command"'"]}' \
--output text \
--query "Command.CommandId")
echo "command_id=$COMMAND_ID" >> $GITHUB_OUTPUT
continue-on-error: true

- name: Poll command status and retrieve live logs
id: poll_output
shell: bash
run: |
start_time=$(date +%s)
timeout=${{ inputs.total_timeout }}
while true; do
STATUS=$(aws ssm list-command-invocations \
--command-id ${{ steps.execute_cmd.outputs.command_id }} \
--details \
--query "CommandInvocations[0].Status" \
--output text)
echo "Command Status: $STATUS"
OUTPUT=$(aws ssm list-command-invocations \
--command-id ${{ steps.execute_cmd.outputs.command_id }} \
--details \
--query "CommandInvocations[0].CommandPlugins[0].Output" \
--output text)
echo "Command Output: $OUTPUT"
if [ "$STATUS" == "Success" ]; then
echo "Command completed successfully."
break
elif [ "$STATUS" == "Failed" ] || [ "$STATUS" == "Cancelled" ]; then
echo "Command failed with status: $STATUS"
break
else
elapsed_time=$(( $(date +%s) - start_time ))
if [ "$elapsed_time" -gt "$timeout" ]; then
echo "Timeout reached. Command execution took more than $timeout seconds."
exit 1
fi
sleep ${{ inputs.check_timeout }}
fi
done
echo "cmd_result=$(echo $OUTPUT)" >> $GITHUB_OUTPUT
1 change: 0 additions & 1 deletion .github/workflows/amd_deb_packager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ jobs:
env:
ARCH: amd64


- name: shasum the package
run: cd packaging/deb/ && sha256sum miden-node-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb > miden-node-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb.checksum
env:
Expand Down
71 changes: 65 additions & 6 deletions .github/workflows/arm_deb_packager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,44 @@ on:
workflow_dispatch:
release:
types: [released, prereleased]
push:
branches:
- next

jobs:
build:
build_package:
permissions:
id-token: write
contents: write
outputs:
target: ${{ steps.build_type_vars_setup.outputs.target }}
tag: ${{ steps.build_type_vars_setup.outputs.tag }}
account_id: ${{ steps.build_type_vars_setup.outputs.account_id }}
instance_id: ${{ steps.build_type_vars_setup.outputs.instance_id }}
runs-on:
labels: ubuntu22-arm-4core
steps:
- name: Checkout
uses: actions/checkout@main
with:
fetch-depth: 0
##### TAG Variable #####

- name: Adding TAG to ENV
run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
run: |
if [[ ${{ github.event_name }} == "release" || ${{ github.event_name }} == "prereleased" ]]; then
echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
else
echo "GIT_TAG=next" >> $GITHUB_ENV
fi
- name: adding version
run: |
NUMERIC_VERSION=$( echo ${{ env.GIT_TAG }} | sed 's/[^0-9.]//g' )
echo "VERSION=$NUMERIC_VERSION" >> $GITHUB_ENV
if [[ ${{ github.event_name }} == "release" || ${{ github.event_name }} == "prereleased" ]]; then
NUMERIC_VERSION=$( echo ${{ env.GIT_TAG }} | sed 's/[^0-9.]//g' )
echo "VERSION=$NUMERIC_VERSION" >> $GITHUB_ENV
else
echo "VERSION=0.1" >> $GITHUB_ENV
fi
- name: cleaning repo
run: cargo clean
Expand Down Expand Up @@ -124,7 +142,7 @@ jobs:
env:
ARCH: arm64

- name: release miden-node Packages
- name: release miden-node Packages for testnet
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.GIT_TAG }}
Expand All @@ -134,3 +152,44 @@ jobs:
packaging/deb/miden-node**.deb.checksum
packaging/deb/miden-faucet**.deb
packaging/deb/miden-faucet**.deb.checksum
if: ${{ github.event_name == 'release' || github.event_name == 'prereleased' }}

- name: release miden-node Packages for devnet
uses: actions/upload-artifact@v3
with:
name: devnet_package
path: |
packaging/deb/miden-node-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb
packaging/deb/miden-node-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb.checksum
packaging/deb/miden-faucet-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb
packaging/deb/miden-faucet-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb.checksum
env:
ARCH: arm64
if: ${{ github.event_name == 'push' }}

- name: Determine build type
id: build_type_vars_setup
run: |
if [[ ${{ github.event_name }} == "release" || ${{ github.event_name }} == "prereleased" ]]; then
echo "target=testnet" >> $GITHUB_OUTPUT
echo "tag=${{ env.GIT_TAG }}" >> $GITHUB_OUTPUT
echo "account_id=MIDEN_DEV_ACCOUNT_ID" >> $GITHUB_OUTPUT
echo "instance_id=TESTNET_INSTANCE_TF" >> $GITHUB_OUTPUT
else
echo "target=devnet" >> $GITHUB_OUTPUT
echo "tag=next" >> $GITHUB_OUTPUT
echo "account_id=MIDEN_DEV_ACCOUNT_ID" >> $GITHUB_OUTPUT
echo "instance_id=DEVNET_INSTANCE_TF" >> $GITHUB_OUTPUT
fi

deploy:
name: Deploy to ${{ needs.build_package.outputs.target }}
needs: build_package
uses: ./.github/workflows/deploy_package.yml
with:
target: ${{ needs.build_package.outputs.target }}
tag: ${{ needs.build_package.outputs.tag }}
account_id: ${{ needs.build_package.outputs.account_id }}
instance_id: ${{ needs.build_package.outputs.instance_id }}
secrets: inherit
149 changes: 0 additions & 149 deletions .github/workflows/deploy.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/deploy_devnet.yml

This file was deleted.

Loading

0 comments on commit 6bb7d51

Please sign in to comment.