Skip to content

Commit b977662

Browse files
committed
Add build ci
1 parent e3e4f14 commit b977662

File tree

4 files changed

+68
-2
lines changed

4 files changed

+68
-2
lines changed

.github/workflows/build.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Flutter build
2+
3+
on:
4+
push:
5+
branches:
6+
- "*"
7+
tags:
8+
- stable
9+
- nightly
10+
release:
11+
types: [published]
12+
pull_request:
13+
jobs:
14+
build-server:
15+
concurrency: ci-${{ github.ref }}
16+
defaults:
17+
run:
18+
working-directory: server
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os:
23+
- name: ubuntu-24.04
24+
label: linux-x86_64
25+
- name: ubuntu-24.04-arm
26+
label: linux-arm64
27+
- name: windows-2025
28+
label: windows-x86_64
29+
- name: macos-latest
30+
label: macos
31+
runs-on: ${{ matrix.os.name }}
32+
steps:
33+
- name: ⬆️ Checkout
34+
uses: actions/checkout@v4
35+
- name: Install yq
36+
if: ${{ matrix.os.name == 'windows-2025' }}
37+
run: choco install yq
38+
- name: Extract Dart SDK version from pubspec.yaml
39+
id: dart_version
40+
shell: bash
41+
run: |
42+
sdk_version=$(yq e '.environment.sdk' pubspec.yaml)
43+
sdk_version="${sdk_version#^}" # Removes leading '^' if present
44+
echo "DART_SDK_VERSION=$sdk_version" >> $GITHUB_ENV
45+
- uses: dart-lang/setup-dart@v1
46+
with:
47+
sdk: ${{ env.DART_SDK_VERSION }}
48+
- name: Print Dart SDK version
49+
run: |
50+
dart --version
51+
- name: Install dependencies
52+
run: |
53+
dart pub get
54+
- name: Compile
55+
run: |
56+
dart compile exe bin/swamp.dart
57+
- name: Create directory
58+
run: |
59+
mkdir -p server-build
60+
mv bin/swamp.exe server-build/
61+
- name: Archive
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: server-build-${{ matrix.os.label }}
65+
path: server/server-build

server/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# https://dart.dev/guides/libraries/private-files
22
# Created by `dart pub`
33
.dart_tool/
4+
/bin/swamp.exe

server/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,4 +597,4 @@ packages:
597597
source: hosted
598598
version: "3.1.3"
599599
sdks:
600-
dart: ">=3.7.0 <4.0.0"
600+
dart: ">=3.7.2 <4.0.0"

server/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ publish_to: none
55
# repository: https://github.com/my_org/my_repo
66

77
environment:
8-
sdk: ^3.7.0
8+
sdk: ^3.7.2
99

1010
dependencies:
1111
swamp_api:

0 commit comments

Comments
 (0)