Skip to content

Commit e47e38a

Browse files
authored
Merge branch 'master' into tl/release-process
2 parents 2613863 + 161c2f7 commit e47e38a

File tree

550 files changed

+21750
-10526
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

550 files changed

+21750
-10526
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# The whole SDK team owns the whole repo for now.
22
* @dfinity/dx
33

4-
# The infra team can still approve Nix PRs.
5-
**/*.nix @dfinity-lab/infra
6-
nix/** @dfinity-lab/infra
7-
8-
# Allows sources.json to be updated without full approval (only CI).
9-
nix/sources.json @ghost
4+
# Allows dfx-asset-sources.json to be updated without full approval (only CI).
5+
src/dfx/assets/dfx-asset-sources.json @ghost
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# List of approved files that can be changed by a bot via an automated PR
2+
# This is to increase security and prevent accidentally updating files that shouldn't be changed by a bot
3+
Cargo.lock
4+
CHANGELOG.md
5+
src/dfx/Cargo.toml
6+
src/dfx/assets/dfx-asset-sources.json

.github/workflows/audit.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ concurrency:
1616
env:
1717
# When getting Rust dependencies, retry on network error:
1818
CARGO_NET_RETRY: 10
19+
# Use the local .curlrc
20+
CURL_HOME: .
21+
# Disable DFX telemetry
22+
DFX_TELEMETRY: 'off'
23+
# Use the stable toolchain for the audit
24+
RUSTUP_TOOLCHAIN: stable
1925

2026
jobs:
2127
test:
@@ -27,4 +33,4 @@ jobs:
2733

2834
steps:
2935
- uses: actions/checkout@v4
30-
- uses: lwshang/audit@cargo_install_locked
36+
- uses: actions-rust-lang/audit@v1

.github/workflows/bitcoin-canister-update.yml

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ on:
55
schedule:
66
- cron: "0 0 * * *" # Runs at UTC midnight every day
77

8+
env:
9+
# When getting Rust dependencies, retry on network error:
10+
CARGO_NET_RETRY: 10
11+
# Use the local .curlrc
12+
CURL_HOME: .
13+
# Disable DFX telemetry
14+
DFX_TELEMETRY: 'off'
15+
816
jobs:
917
check-update:
1018
runs-on: ubuntu-latest
@@ -15,18 +23,27 @@ jobs:
1523
with:
1624
token: ${{ secrets.GITHUB_TOKEN }}
1725

26+
- name: Install script dependencies
27+
run: sudo apt-get install -y moreutils
28+
29+
- name: Create GitHub App Token
30+
uses: actions/create-github-app-token@v2
31+
id: app-token
32+
with:
33+
app-id: ${{ vars.PR_AUTOMATION_BOT_PUBLIC_APP_ID }}
34+
private-key: ${{ secrets.PR_AUTOMATION_BOT_PUBLIC_PRIVATE_KEY }}
35+
1836
- name: Fetch Bitcoin Canister latest release tag
1937
env:
20-
GH_TOKEN: "${{ secrets.NIV_UPDATER_TOKEN }}"
38+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
2139
run: |
2240
LATEST_TAG=$(gh release view --repo dfinity/bitcoin-canister --json tagName -q .tagName)
2341
echo "Latest tag is $LATEST_TAG"
2442
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
2543
2644
- name: Check if the latest release tag has been updated
2745
run: |
28-
URL_ENCODED_CURRENT_TAG=$(jq -r '.["ic-btc-canister"].version' nix/sources.json)
29-
CURRENT_TAG=$(python -c "import sys, urllib.parse as ul; print(ul.unquote_plus(sys.argv[1]))" "$URL_ENCODED_CURRENT_TAG")
46+
CURRENT_TAG=$(jq -r '.commmon."ic-btc-canister".version' src/dfx/assets/dfx-asset-sources.json)
3047
echo "Current tag is $CURRENT_TAG"
3148
if [[ "$CURRENT_TAG" == "$LATEST_TAG" ]]; then
3249
echo "No update is required."
@@ -35,26 +52,19 @@ jobs:
3552
echo "An update is required."
3653
fi
3754
38-
- name: install Nix
39-
uses: cachix/install-nix-action@v21
40-
with:
41-
nix_path: nixpkgs=channel:nixos-unstable
55+
- name: Update sources to use the latest bitcoin canister version
56+
run: ./scripts/update-btc-canister.sh "$LATEST_TAG"
4257

43-
- name: install niv (dependency manager for Nix projects)
44-
run: nix-env -i niv -f '<nixpkgs>'
45-
46-
- name: install packages from nix/sources.json
47-
run: niv update
48-
49-
- name: update sources
50-
run: |
51-
URL_ENCODED_LATEST_TAG=$(echo -n "$LATEST_TAG" | python -c 'import sys, urllib.parse; print(urllib.parse.quote(sys.stdin.read().strip(), safe=""))')
52-
niv update ic-btc-canister -a version=$URL_ENCODED_LATEST_TAG
53-
./scripts/write-dfx-asset-sources.sh
58+
- name: Create GitHub App Token
59+
uses: actions/create-github-app-token@v2
60+
id: app-token
61+
with:
62+
app-id: ${{ vars.PR_AUTOMATION_BOT_PUBLIC_APP_ID }}
63+
private-key: ${{ secrets.PR_AUTOMATION_BOT_PUBLIC_PRIVATE_KEY }}
5464

55-
- name: Update dfx to use the latest Bitcoin Canister version
65+
- name: Create PR
5666
env:
57-
GH_TOKEN: "${{ secrets.NIV_UPDATER_TOKEN }}"
67+
GH_TOKEN: "${{ steps.app-token.outputs.token }}"
5868
run: |
5969
git config user.name github-actions
6070
git config user.email github-actions@github.com

.github/workflows/broadcast-frontend-hash.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ env:
1818
PLAYGROUND_REPO: ${{ github.repository_owner }}/motoko-playground
1919
FILE: service/wasm-utils/whitelisted_wasms.txt
2020

21+
# When getting Rust dependencies, retry on network error:
22+
CARGO_NET_RETRY: 10
23+
# Use the local .curlrc
24+
CURL_HOME: .
25+
# Disable DFX telemetry
26+
DFX_TELEMETRY: 'off'
27+
2128
jobs:
2229
update-frontend-hash:
2330
runs-on: ubuntu-latest
@@ -39,10 +46,17 @@ jobs:
3946
git checkout ${{ inputs.dfx_version }}
4047
echo "NEW_HASH=$(shasum -a 256 src/distributed/assetstorage.wasm.gz | cut -f1 -d" ")" >> $GITHUB_ENV
4148
49+
- name: Create GitHub App Token
50+
uses: actions/create-github-app-token@v2
51+
id: app-token
52+
with:
53+
app-id: ${{ vars.PR_AUTOMATION_BOT_PUBLIC_APP_ID }}
54+
private-key: ${{ secrets.PR_AUTOMATION_BOT_PUBLIC_PRIVATE_KEY }}
55+
4256
- name: Checkout dfinity/motoko-playground repo
4357
uses: actions/checkout@v4
4458
with:
45-
token: ${{ secrets.NIV_UPDATER_TOKEN }}
59+
token: ${{ steps.app-token.outputs.token }}
4660
repository: ${{ env.PLAYGROUND_REPO }}
4761
path: motoko-playground
4862

@@ -56,9 +70,16 @@ jobs:
5670
echo ' "${{ env.NEW_HASH }}", // dfx ${{ inputs.dfx_version }} frontend canister' >> ${{ env.FILE }}
5771
echo ']' >> ${{ env.FILE }}
5872
73+
- name: Create GitHub App Token
74+
uses: actions/create-github-app-token@v2
75+
id: app-token
76+
with:
77+
app-id: ${{ vars.PR_AUTOMATION_BOT_PUBLIC_APP_ID }}
78+
private-key: ${{ secrets.PR_AUTOMATION_BOT_PUBLIC_PRIVATE_KEY }}
79+
5980
- name: Commit files, push changes, and create PR
6081
env:
61-
GH_TOKEN: ${{ secrets.NIV_UPDATER_TOKEN }}
82+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
6283
working-directory: ./motoko-playground
6384
run: |
6485
git config author.email "${{ github.event.sender.id }}+${{ github.event.sender.login }}@users.noreply.github.com"

.github/workflows/build-frontend-canister.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ env:
1919
CARGO_NET_RETRY: 10
2020
# Use the local .curlrc
2121
CURL_HOME: .
22+
# Disable DFX telemetry
23+
DFX_TELEMETRY: 'off'
2224

2325
jobs:
2426
frontend:

.github/workflows/consistent-sources.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/conventional-commits.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ env:
1616
CARGO_NET_RETRY: 10
1717
# Use the local .curlrc
1818
CURL_HOME: .
19+
# Disable DFX telemetry
20+
DFX_TELEMETRY: 'off'
1921

2022
jobs:
2123
check:

.github/workflows/deny.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ env:
1515
CARGO_NET_RETRY: 10
1616
# Use the local .curlrc
1717
CURL_HOME: .
18+
# Disable DFX telemetry
19+
DFX_TELEMETRY: 'off'
1820

1921
jobs:
2022
cargo-deny:
2123
name: license-check:required
2224
runs-on: ubuntu-latest
2325
steps:
2426
- uses: actions/checkout@v4
25-
- uses: EmbarkStudios/cargo-deny-action@v1
27+
- run: rm rust-toolchain.toml
28+
- uses: EmbarkStudios/cargo-deny-action@v2
2629
with:
2730
command: check bans licenses sources # skip advisories, which are handled by audit.yml

.github/workflows/e2e.yml

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ env:
1414
CARGO_NET_RETRY: 10
1515
# Use the local .curlrc
1616
CURL_HOME: .
17+
# Disable DFX telemetry
18+
DFX_TELEMETRY: 'off'
1719

1820
jobs:
1921
changes:
@@ -53,15 +55,15 @@ jobs:
5355
matrix:
5456
# We build a dynamic-linked linux binary because otherwise HSM support fails with:
5557
# Error: IO: Dynamic loading not supported
56-
os: [macos-12, ubuntu-20.04, ubuntu-22.04, windows-2022]
58+
os: [macos-13, ubuntu-22.04, ubuntu-24.04, windows-2022]
5759
include:
58-
- os: macos-12
60+
- os: macos-13
5961
target: x86_64-apple-darwin
6062
binary_path: target/x86_64-apple-darwin/release/dfx
61-
- os: ubuntu-20.04
63+
- os: ubuntu-22.04
6264
target: x86_64-unknown-linux-gnu
6365
binary_path: target/x86_64-unknown-linux-gnu/release/dfx
64-
- os: ubuntu-22.04
66+
- os: ubuntu-24.04
6567
target: x86_64-unknown-linux-gnu
6668
binary_path: target/x86_64-unknown-linux-gnu/release/dfx
6769
- os: windows-2022
@@ -109,7 +111,7 @@ jobs:
109111
strategy:
110112
fail-fast: false
111113
matrix:
112-
os: [macos-12, ubuntu-20.04, ubuntu-22.04]
114+
os: [macos-13, ubuntu-22.04, ubuntu-24.04]
113115
steps:
114116
- uses: actions/checkout@v4
115117
- name: Download dfx binary
@@ -160,9 +162,6 @@ jobs:
160162
echo "archive=$(pwd)/e2e/archive" >> "$GITHUB_ENV"
161163
echo "assets=$(pwd)/e2e/assets" >> "$GITHUB_ENV"
162164
echo "utils=$(pwd)/e2e/utils" >> "$GITHUB_ENV"
163-
if [ "${{ matrix.backend == 'pocketic' || '' }}" ]; then
164-
echo "USE_POCKETIC=1" >> "$GITHUB_ENV"
165-
fi
166165
export
167166
- name: Download bats-support as a git submodule
168167
run: git submodule update --init --recursive
@@ -173,7 +172,7 @@ jobs:
173172
e2e/assets/playground_backend/.mops
174173
key: playground-backend-mops-${{ hashFiles('e2e/assets/playground_backend/mops.toml') }}
175174
- name: Run e2e test
176-
run: timeout 2400 bats "e2e/$E2E_TEST"
175+
run: timeout 2400 bats ${{ !matrix.serial && '-j "$(nproc)"' || '' }} "e2e/$E2E_TEST"
177176

178177
ui_test:
179178
runs-on: ${{ matrix.os }}
@@ -182,7 +181,7 @@ jobs:
182181
strategy:
183182
fail-fast: false
184183
matrix:
185-
os: [macos-12, ubuntu-20.04, ubuntu-22.04]
184+
os: [macos-13, ubuntu-22.04, ubuntu-24.04]
186185
steps:
187186
- name: Checking out repo
188187
uses: actions/checkout@v4
@@ -192,7 +191,7 @@ jobs:
192191
python-version: "3.9"
193192
- name: Installing playwright
194193
run: |
195-
pip install playwright==1.40.0
194+
pip install playwright==1.50.0
196195
playwright install
197196
playwright install-deps
198197
- name: Download dfx binary
@@ -222,6 +221,46 @@ jobs:
222221
--frontend_url "$FRONTEND_URL_LOCALHOST" \
223222
--candid_url "$CANDID_URL_LOCALHOST" \
224223
--browser chromium firefox webkit
224+
- name: Deploy sveltekit starter project
225+
run: |
226+
dfx new e2e_project_sveltekit --frontend sveltekit
227+
pushd e2e_project_sveltekit
228+
dfx canister create e2e_project_sveltekit_frontend --specified-id erxue-5aaaa-aaaab-qaagq-cai
229+
dfx deploy
230+
popd
231+
rm -rf e2e_project_sveltekit
232+
- name: Deploy react starter project
233+
run: |
234+
dfx new e2e_project_react --frontend react
235+
pushd e2e_project_react
236+
dfx canister create e2e_project_react_frontend --specified-id rdbii-uiaaa-aaaab-qadva-cai
237+
dfx deploy
238+
popd
239+
rm -rf e2e_project_react
240+
- name: Deploy vanilla starter project
241+
run: |
242+
dfx new e2e_project_vanilla --frontend vanilla
243+
pushd e2e_project_vanilla
244+
dfx canister create e2e_project_vanilla_frontend --specified-id qjoks-wyaaa-aaaab-qadsa-cai
245+
dfx deploy
246+
popd
247+
rm -rf e2e_project_vanilla
248+
- name: Deploy vue starter project
249+
run: |
250+
dfx new e2e_project_vue --frontend vue
251+
pushd e2e_project_vue
252+
dfx canister create e2e_project_vue_frontend --specified-id qopmg-3aaaa-aaaab-qadsq-cai
253+
dfx deploy
254+
popd
255+
rm -rf e2e_project_vue
256+
# Add any additional deployments here
257+
- name: Install Playwright Browsers and Run Tests
258+
run: |
259+
pushd e2e/playwright/
260+
npm install
261+
npx playwright install --with-deps
262+
npx playwright test
263+
popd
225264
226265
aggregate:
227266
name: e2e:required

0 commit comments

Comments
 (0)