Skip to content
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

Example/test maintenance: update dependencies, formatting, and linting #2388

Merged
merged 11 commits into from
Dec 30, 2024
Merged
  •  
  •  
  •  
58 changes: 48 additions & 10 deletions .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,44 @@
name: Example/test maintenance (package-lock updating, formatting, linting)
on:
workflow_dispatch:
inputs:
signing-key-id:
required: true
type: string
default: C8B77BCBE16CD2B94B43F9C8757397B82D4ED7B0
schedule:
# Run at 10:00 UTC (4:00 AM MT) every day
- cron: '0 10 * * *'

jobs:
determine-signing-key:
runs-on: ubuntu-latest
outputs:
signing-key-id: ${{ steps.set-key.outputs.key }}
steps:
- id: set-key
run: echo "key=C8B77BCBE16CD2B94B43F9C8757397B82D4ED7B0" >> $GITHUB_OUTPUT

determine-prefix:
runs-on: ubuntu-latest
outputs:
prefix: ${{ steps.set-prefix.outputs.prefix }}
steps:
- id: set-prefix
run: echo "prefix=maintenance-$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT

create-branch-prefix:
needs:
- determine-signing-key
- determine-prefix
uses: ./.github/workflows/create_branch_prefix.yml
with:
prefix: 'maintenance'
prefix: ${{ needs.determine-prefix.outputs.prefix }}
version: $(jq -r '.version' package.json)
signing-key-id: ${{ inputs.signing-key-id }}
signing-key-id: ${{ needs.determine-signing-key.outputs.signing-key-id }}
secrets:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}

prepare-maintenance:
name: Prepare Maintenance
needs:
- create-branch-prefix
- determine-signing-key
runs-on: ubuntu-latest
outputs:
test-infos: ${{ steps.get-test-infos.outputs.test-infos }}
Expand All @@ -32,6 +50,8 @@ jobs:

- uses: ./.github/actions/setup_node

- uses: ./.github/actions/setup_dfx

- run: npm install

# Run global prettier/lint fixes
Expand All @@ -46,7 +66,7 @@ jobs:
branch-name: ${{ needs.create-branch-prefix.outputs.base-branch }}
commit-message: 'Example/test maintenance: formatting and linting'
gpg-signing-key: ${{ secrets.GPG_SIGNING_KEY }}
signing-key-id: ${{ inputs.signing-key-id }}
signing-key-id: ${{ needs.determine-signing-key.outputs.signing-key-id }}

- id: get-test-infos
uses: ./.github/actions/get_test_infos
Expand All @@ -57,6 +77,7 @@ jobs:
needs:
- prepare-maintenance
- create-branch-prefix
- determine-signing-key
name: Update dependencies for ${{ matrix.test.name }}
runs-on: ubuntu-latest
env:
Expand All @@ -74,6 +95,8 @@ jobs:

- uses: ./.github/actions/setup_node

- uses: ./.github/actions/setup_dfx

# Update package-lock.json in test directory
- name: Update package-lock.json
working-directory: ${{ matrix.test.path }}
Expand All @@ -94,18 +117,19 @@ jobs:
commit-message: 'Example/test maintenance: update dependencies'
gpg-signing-key: ${{ secrets.GPG_SIGNING_KEY }}
create-branch: 'true'
signing-key-id: ${{ inputs.signing-key-id }}
signing-key-id: ${{ needs.determine-signing-key.outputs.signing-key-id }}

squash-branches:
needs:
- update-test-dependencies
- create-branch-prefix
- determine-signing-key
uses: ./.github/workflows/squash_branches.yml
with:
base-branch: ${{ needs.create-branch-prefix.outputs.base-branch }}
branch-prefix: ${{ needs.create-branch-prefix.outputs.branch-prefix }}
commit-message: 'Example/test maintenance: update dependencies'
signing-key-id: ${{ inputs.signing-key-id }}
signing-key-id: ${{ needs.determine-signing-key.outputs.signing-key-id }}
secrets:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -120,8 +144,22 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0

- name: Check for differences
id: check-diff
run: |
git fetch origin main
if git diff --quiet origin/main ${{ needs.create-branch-prefix.outputs.base-branch }}; then
echo "No differences found between branches"
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "Changes detected"
echo "has_changes=true" >> $GITHUB_OUTPUT
fi

- name: Create Pull Request
if: steps.check-diff.outputs.has_changes == 'true'
env:
GH_TOKEN: ${{ secrets.LASTMJS_GITHUB_TOKEN }}
run: |
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/squash_branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,20 @@ jobs:
git merge --squash $branch
done

# Create a merge commit with a descriptive message
git commit -am "${{ inputs.commit-message }}"

git push origin HEAD:$CURRENT_BRANCH
# Check if there are any changes to commit
if git diff --staged --quiet; then
echo "No changes to commit"
else
# Create a merge commit with a descriptive message
git commit -am "${{ inputs.commit-message }}"
git push origin HEAD:$CURRENT_BRANCH
fi

- name: Delete branches
run: |
echo "Starting branch deletion process..."
git push origin --delete ${{ steps.collect-branches.outputs.branches }}
if [ -n "$(echo ${{ steps.collect-branches.outputs.branches }} | tr -d '[:space:]')" ]; then
echo "Starting branch deletion process..."
git push origin --delete ${{ steps.collect-branches.outputs.branches }}
else
echo "No branches to delete"
fi
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ target
/the_azle_book/book
/docs
static_canister_template_licenses.yml
.azle
dfx_generated
.bitcoin
licenses.yml
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ TypeScript and JavaScript CDK for the [Internet Computer](https://internetcomput

Please remember that Azle is in beta and thus it may have unknown security vulnerabilities due to the following:

- Azle is built with various software packages that have not yet reached maturity
- Azle does not yet have multiple independent security reviews/audits
- Azle does not yet have many live, successful, continuously operating applications deployed to ICP
- Azle is built with various software packages that have not yet reached maturity
- Azle does not yet have multiple independent security reviews/audits
- Azle does not yet have many live, successful, continuously operating applications deployed to ICP

## Get Started

Expand Down
6 changes: 3 additions & 3 deletions contributing/casing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Casing

- Generally camel or pascal case should be used that matches TypeScript/JavaScript conventions
- Filenames and directory names should use snake case
- Numbers should still use snake case
- Generally camel or pascal case should be used that matches TypeScript/JavaScript conventions
- Filenames and directory names should use snake case
- Numbers should still use snake case
18 changes: 9 additions & 9 deletions contributing/dependency_updates.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
During every release of Azle, the goal should be to update the following:

- dfx
- boa
- ic-cdk
- ic-cdk-macros
- candid
- ic-cdk-timers
- ic-stable-structures
- Cargo.lock
- Rust
- dfx
- boa
- ic-cdk
- ic-cdk-macros
- candid
- ic-cdk-timers
- ic-stable-structures
- Cargo.lock
- Rust
4 changes: 2 additions & 2 deletions examples/experimental/demo/basic_bitcoin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ Now if you call the functions with the `n2dcQfuwFw7M2UYzLfM6P7DwewsQaygb8S` addr

If you need more information you can view the following:

- [Developing Bitcoin dapps locally]()https://internetcomputer.org/docs/current/developer-docs/integrations/bitcoin/local-development
- [Deploying your first Bitcoin dapp](https://internetcomputer.org/docs/current/samples/deploying-your-first-bitcoin-dapp)
- [Developing Bitcoin dapps locally]()https://internetcomputer.org/docs/current/developer-docs/integrations/bitcoin/local-development
- [Deploying your first Bitcoin dapp](https://internetcomputer.org/docs/current/samples/deploying-your-first-bitcoin-dapp)
Loading
Loading