Skip to content

Commit

Permalink
Merge branch 'main' into feat/redo-invitation-code
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker authored Oct 18, 2024
2 parents 15e49bb + 41ad110 commit 545f06a
Show file tree
Hide file tree
Showing 96 changed files with 2,307 additions and 1,123 deletions.
29 changes: 29 additions & 0 deletions .github/actions/create-pr/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Create Pull Request

description: Create a pull request for the changes that were detected

inputs:
title:
description: 'Title and commit message for the PR'
required: true
body:
description: 'Body of the PR'
required: true
branch:
description: 'Branch name for the PR'
required: true

runs:
using: 'composite'
steps:
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
base: main
commit-message: ${{ inputs.title }}
committer: GitHub <[email protected]>
author: gix-bot <[email protected]>
branch: ${{ inputs.branch }}
delete-branch: true
title: ${{ inputs.title }}
body: ${{ inputs.body }}
5 changes: 3 additions & 2 deletions .github/scripts/candid
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

function copy_candid() {
local canister=$1
local file=${2:-"$canister".did}

cp src/"$canister"/"$canister".did .
cp src/"$canister"/"$file" .
}

copy_candid "$CANISTER"
copy_candid "$CANISTER" "$CUSTOM_DID_FILE"
26 changes: 25 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,33 @@ jobs:
name: ${{ matrix.name }}
path: ./${{ matrix.name }}

candid_extension:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: satellite_extension.did
target: satellite
custom_did_file: satellite_extension.did

steps:
- uses: actions/checkout@v4

- name: 'Copy ${{ matrix.name }}'
run: bash .github/scripts/candid
env:
CANISTER: ${{ matrix.target }}
CUSTOM_DID_FILE: ${{ matrix.custom_did_file }}

- name: 'Upload ${{ matrix.name }}'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
path: ./${{ matrix.name }}

release:
runs-on: ubuntu-latest
needs: ['docker-build', 'metadata', 'candid']
needs: ['docker-build', 'metadata', 'candid', 'candid_extension']
steps:
- uses: actions/checkout@v4

Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/update-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Update Env

on:
schedule:
- cron: '30 3 * * MON'
workflow_dispatch:

jobs:
update-subnets:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare
uses: ./.github/actions/prepare
- name: Update
run: npm run build:subnets

- name: Check for Changes
run: |
if ! git diff --quiet; then
echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
fi
# This action creates a PR only if there are changes.
- name: Create Pull Request
if: env.CHANGES_DETECTED == 'true'
uses: ./.github/actions/create-pr
with:
branch: bot-cmc-subnets-update
title: 'feat(frontend): Update Subnets'
body: |
Modifications have been made to the list of default subnets known by the CMC canister.
61 changes: 61 additions & 0 deletions .github/workflows/update-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# A GitHub Actions workflow that regularly checks for new Rust toolchain release
# and creates a PR on new versions.
name: Update Rust

on:
schedule:
# check for new rust versions weekly
- cron: '30 3 * * FRI'
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
rust-update:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

# First, check rust GitHub releases for a new version. We assume that the
# latest version's tag name is the version.
- name: Check new rust version
id: update
run: |
current_rust_version=$(cat ./rust-toolchain.toml | sed -n 's/^channel[[:space:]]*=[[:space:]]"\(.*\)"/\1/p')
echo "current rust version '$current_rust_version'"
release_data=$(curl --silent -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/rust-lang/rust/releases/latest)
latest_rust_version=$(echo -n "$release_data" | jq -cMr .tag_name)
# The GitHub API has some hiccups, so we check the value before going further
if [ -z "$latest_rust_version" ] || [ "$latest_rust_version" = "null" ]
then
echo "expected a rust version, got '$latest_rust_version'"
echo "data received from API:"
echo "$release_data"
exit 1
fi
echo "latest rust version '$latest_rust_version'"
if [ "$current_rust_version" != "$latest_rust_version" ]
then
echo rust toolchain needs an update
sed -i -e "s/$current_rust_version/$latest_rust_version/g" ./rust-toolchain.toml
echo "updated=1" >> "$GITHUB_OUTPUT"
else
echo "updated=0" >> "$GITHUB_OUTPUT"
fi
cat ./rust-toolchain.toml
# This action creates a PR only if there are changes.
- name: Create Pull Request
if: ${{ steps.update.outputs.updated == '1' }}
uses: ./.github/actions/create-pr
with:
branch: bot-rust-update
title: 'build(backend): Update Rust version'
body: |
A new Rust version available.
38 changes: 19 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ homepage = "https://juno.build"

[workspace.dependencies]
candid = "0.10.2"
ic-cdk = "0.15.1"
ic-cdk-macros = "0.15.0"
ic-ledger-types = "0.12.0"
ic-cdk = "0.16.0"
ic-cdk-macros = "0.16.0"
ic-ledger-types = "0.13.0"
icrc-ledger-types = "0.1.6"
ic-cdk-timers = "0.9.0"
ic-cdk-timers = "0.10.0"
ic-stable-structures = "0.6.4"
serde = "1.0.190"
serde_cbor = "0.11.2"
Expand Down
Loading

0 comments on commit 545f06a

Please sign in to comment.