Skip to content

Commit 8b43f33

Browse files
committed
Fixes #1023 - Update GitHub Actions Dart Version
1 parent bcd94d1 commit 8b43f33

5 files changed

Lines changed: 51 additions & 88 deletions

File tree

.github/workflows/dart.yml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,19 @@ jobs:
88
run_unit_tests:
99
if: github.event.pull_request.draft == false
1010

11-
runs-on: ubuntu-22.04
12-
11+
runs-on: ubuntu-22.04 # Could use ubuntu-latest
1312
steps:
14-
- name: Setup Dart SDK Step 1
15-
run: sudo apt-get update
16-
- name: Setup Dart SDK Step 2
17-
run: sudo apt-get install apt-transport-https
18-
- name: Setup Dart SDK Step 3
19-
run: sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
20-
- name: Setup Dart SDK Step 4
21-
run: sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
22-
- name: Setup Dart SDK Step 5
23-
run: wget -O /tmp/dart_3.5.4-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/3.5.4/linux_packages/dart_3.5.4-1_amd64.deb
24-
- name: Setup Dart SDK Step 6
25-
run: sudo apt install /tmp/dart_3.5.4-1_amd64.deb
26-
- uses: actions/checkout@v4
13+
- name: Checkout branch
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Dart SDK
17+
uses: dart-lang/setup-dart@v1 # https://github.com/dart-lang/setup-dart
18+
2719
- name: Install dependencies
28-
run: PATH="$PATH:/usr/lib/dart/bin" dart pub get
29-
- name: Run tests
30-
run: PATH="$PATH:/usr/lib/dart/bin" dart run build_runner test
20+
run: dart pub get
21+
22+
- name: Run Tests
23+
run: dart run build_runner test
3124

3225
fail_if_pull_request_is_draft:
3326
if: github.event.pull_request.draft == true

.github/workflows/dart_formatting.yml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,19 @@ jobs:
88
check_formatting:
99
if: github.event.pull_request.draft == false
1010

11-
runs-on: ubuntu-22.04
12-
11+
runs-on: ubuntu-22.04 # Could use ubuntu-latest
1312
steps:
14-
- name: Setup Dart SDK Step 1
15-
run: sudo apt-get update
16-
- name: Setup Dart SDK Step 2
17-
run: sudo apt-get install apt-transport-https
18-
- name: Setup Dart SDK Step 3
19-
run: sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
20-
- name: Setup Dart SDK Step 4
21-
run: sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
22-
- name: Setup Dart SDK Step 5
23-
run: wget -O /tmp/dart_3.5.4-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/3.5.4/linux_packages/dart_3.5.4-1_amd64.deb
24-
- name: Setup Dart SDK Step 6
25-
run: sudo apt install /tmp/dart_3.5.4-1_amd64.deb
26-
- uses: actions/checkout@v4
13+
- name: Checkout branch
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Dart SDK
17+
uses: dart-lang/setup-dart@v1 # https://github.com/dart-lang/setup-dart
18+
2719
- name: Install dependencies
28-
run: PATH="$PATH:/usr/lib/dart/bin" dart pub get
20+
run: dart pub get
21+
2922
- name: Verify formatting
30-
run: PATH="$PATH:/usr/lib/dart/bin" dart format -l 110 --output=none --set-exit-if-changed .
23+
run: dart format -l 110 --output=none --set-exit-if-changed .
3124

3225
fail_if_pull_request_is_draft:
3326
if: github.event.pull_request.draft == true

.github/workflows/gh-pages-dev.yml

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,27 @@ jobs:
1010
runs-on: ubuntu-22.04
1111
steps:
1212
- name: Checkout dev branch
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414
with:
1515
ref: dev
1616

1717
- name: Checkout gh-pages branch
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919
with:
2020
ref: gh-pages
2121
path: gh-pages-repo
2222

23-
24-
25-
- name: Setup Dart SDK Step 1
26-
run: sudo apt-get update
27-
- name: Setup Dart SDK Step 2
28-
run: sudo apt-get install apt-transport-https
29-
- name: Setup Dart SDK Step 3
30-
run: sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
31-
- name: Setup Dart SDK Step 4
32-
run: sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
33-
- name: Setup Dart SDK Step 5
34-
run: wget -O /tmp/dart_3.5.4-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/3.5.4/linux_packages/dart_3.5.4-1_amd64.deb
35-
- name: Setup Dart SDK Step 6
36-
run: sudo apt install /tmp/dart_3.5.4-1_amd64.deb
23+
- name: Setup Dart SDK
24+
uses: dart-lang/setup-dart@v1 # https://github.com/dart-lang/setup-dart
3725

3826
- name: Install dependencies
39-
run: PATH="$PATH:/usr/lib/dart/bin" dart pub get
27+
run: dart pub get
4028

4129
- name: Install webdev
42-
run: PATH="$PATH:/usr/lib/dart/bin" dart pub global activate webdev
43-
30+
run: dart pub global activate webdev
4431

4532
- name: Build into gh-pages repo
46-
run: PATH="$PATH:/usr/lib/dart/bin" dart pub global run webdev build -o web:gh-pages-repo/dev
47-
33+
run: dart pub global run webdev build -o web:gh-pages-repo/dev
4834

4935
- name: Deploy
5036
uses: peaceiris/actions-gh-pages@v3

.github/workflows/gh-pages.yml

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,45 +8,36 @@ on:
88
jobs:
99
deploy:
1010
runs-on: ubuntu-22.04
11+
1112
steps:
1213
- name: Checkout main branch
13-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
1415

1516
- name: Checkout gh-pages branch
16-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1718
with:
1819
ref: gh-pages
1920
path: gh-pages-repo
2021

22+
- name: Setup Dart SDK
23+
uses: dart-lang/setup-dart@v1 # https://github.com/dart-lang/setup-dart
2124

22-
23-
- name: Setup Dart SDK Step 1
24-
run: sudo apt-get update
25-
- name: Setup Dart SDK Step 2
26-
run: sudo apt-get install apt-transport-https
27-
- name: Setup Dart SDK Step 3
28-
run: sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
29-
- name: Setup Dart SDK Step 4
30-
run: sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
31-
- name: Setup Dart SDK Step 5
32-
run: wget -O /tmp/dart_3.5.4-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/3.5.4/linux_packages/dart_3.5.4-1_amd64.deb
33-
- name: Setup Dart SDK Step 6
34-
run: sudo apt install /tmp/dart_3.5.4-1_amd64.deb
3525
- name: Install dependencies
36-
run: PATH="$PATH:/usr/lib/dart/bin" dart pub get
37-
38-
- name: Install webdev
39-
run: PATH="$PATH:/usr/lib/dart/bin" dart pub global activate webdev
26+
run: dart pub get
4027

28+
- name: Activate webdev
29+
run: dart pub global activate webdev
4130

4231
- name: Build into gh-pages repo
43-
run: PATH="$PATH:/usr/lib/dart/bin" dart pub global run webdev build -o web:/tmp/scadnano ; cp -r /tmp/scadnano/* gh-pages-repo
32+
run: dart pub global run webdev build -o web:/tmp/scadnano ; cp -r /tmp/scadnano/* gh-pages-repo
33+
4434
- name: Retrieve version
45-
run: echo "VERSION=$(cat lib/src/constants.dart | grep 'const String CURRENT_VERSION = .*' | grep -oP '\d+\.\d+\.\d+')" >> $GITHUB_ENV
35+
run: echo "VERSION=$(cat lib/src/constants.dart | grep 'const String CURRENT_VERSION = .*' | grep -oP '\d+\.\d+\.\d+')" >> $GITHUB_ENV
36+
4637
- name: Build into gh-pages-repo/VERSION
4738
run: |
4839
if [ "$VERSION" != "" ]; then
49-
PATH="$PATH:/usr/lib/dart/bin" dart pub global run webdev build -o web:gh-pages-repo/v$VERSION
40+
dart pub global run webdev build -o web:gh-pages-repo/v$VERSION
5041
else
5142
echo "::warning deploying VERSION skipped because VERSION number could not be found"
5243
fi

CONTRIBUTING.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -241,23 +241,23 @@ git checkout dev
241241

242242
### Installing Dart
243243

244-
This project requires using Dart version **3.5.4**, not the latest version. Click on a dropdown below for installation instructions for your operating system.
244+
This project requires using Dart version **3.7.3**, not the latest version. Click on a dropdown below for installation instructions for your operating system.
245245

246246
<!--TODO: Find a way to use code blocks with syntax highlighting inside <details>-->
247247

248248
<details><summary><strong>Windows</strong></summary>
249249
First, install <a href="https://chocolatey.org/install">Chocolatey</a> if you haven't already. If <code>choco help</code> shows a help menu for using Chocolatey, then you've set it up correctly.
250250

251-
Then, open a shell (cmd/Powershell) with Administrative privileges (go to Start type `cmd`, right-click on "Command Prompt", or type Powershell and right-click on "Powershell"; in both cases pick "Run as administrator") and install Dart 3.5.4:
251+
Then, open a shell (cmd/Powershell) with Administrative privileges (go to Start type `cmd`, right-click on "Command Prompt", or type Powershell and right-click on "Powershell"; in both cases pick "Run as administrator") and install Dart 3.7.3:
252252

253253
<pre>
254-
choco install dart-sdk --version 3.5.4
254+
choco install dart-sdk --version 3.7.3
255255
</pre>
256256

257257
To stop Chocolatey from automatically updating Dart to the latest version, pin it:
258258

259259
<pre>
260-
choco pin --name="'dart-sdk'" --version="'3.5.4'"
260+
choco pin --name="'dart-sdk'" --version="'3.7.3'"
261261
</pre>
262262

263263
</details>
@@ -267,16 +267,16 @@ First, install <a href="https://brew.sh/">Homebrew</a> if you haven't already. I
267267

268268
It may help to run `brew tap dart-lang/dart` first.
269269

270-
Then, install Dart 3.5.4:
270+
Then, install Dart 3.7.3:
271271

272272
<pre>
273-
brew install dart@3.5.4
273+
brew install dart@3.7.3
274274
</pre>
275275

276276
To stop Homebrew from automatically updating Dart to the latest version, pin it:
277277

278278
<pre>
279-
brew pin dart@3.5.4
279+
brew pin dart@3.7.3
280280
</pre>
281281

282282
If running `dart` in a terminal now does not work, you may need to follow <a href="https://docs.brew.sh/FAQ#my-mac-apps-dont-find-homebrew-utilities">these instructions</a>.
@@ -292,17 +292,17 @@ wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo gpg --dea
292292
echo 'deb [signed-by=/usr/share/keyrings/dart.gpg arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list
293293
</pre>
294294

295-
Then, install Dart 3.5.4:
295+
Then, install Dart 3.7.3:
296296

297297
<pre>
298298
sudo apt-get update
299-
sudo apt-get install dart=3.5.4
299+
sudo apt-get install dart=3.7.3
300300
</pre>
301301

302302
To stop apt from automatically updating Dart to the latest version, hold it:
303303

304304
<pre>
305-
sudo apt-mark hold dart=3.5.4
305+
sudo apt-mark hold dart=3.7.3
306306
</pre>
307307

308308
</details>

0 commit comments

Comments
 (0)