-
-
Notifications
You must be signed in to change notification settings - Fork 1
103 lines (81 loc) · 2.91 KB
/
build-for-release.yml
File metadata and controls
103 lines (81 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Build for Release
on:
workflow_dispatch:
inputs:
TAG_NAME:
description: 'Version (Tag Name)'
required: true
env:
FLUTTER_VERSION: '3.41.1'
run-name: Build release version ${{ inputs.TAG_NAME }}
jobs:
check-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install system dependencies
run: sudo apt-get install -y jq
- name: Install yq
run: pip install yq
- name: Check tag with project version
run: |
TAG_NAME=${{ github.event.inputs.TAG_NAME }}
PROJECT_VERSION=$(yq .version pubspec.yaml --raw-output)
# Remove 'v' prefix from tag name
TAG_VERSION=$(sed 's/^v//g' <<< "$TAG_NAME")
if [ "$PROJECT_VERSION" != "$TAG_VERSION" ]; then
echo "::error title=Mismatched Versions!::Project version ($PROJECT_VERSION) does not match tag ($TAG_VERSION)"
exit 1
fi
linux:
needs: check-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install system dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Configure Flutter
run: flutter config --enable-linux-desktop
- name: Get dependencies
run: flutter pub get
- name: Build
run: flutter build linux --release --dart-define=version=${{ github.event.inputs.TAG_NAME }}
- name: Prepare for upload
run: |
mkdir upload
mv ./build/linux/x64/release/bundle/ ./upload/BlueMapGUI_${{ github.event.inputs.TAG_NAME }}_Linux_x64/
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: "BlueMapGUI_${{ github.event.inputs.TAG_NAME }}_Linux_x64"
path: './upload/'
windows:
needs: check-version
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Configure Flutter
run: flutter config --enable-windows-desktop
- name: Get dependencies
run: flutter pub get
- name: Build
run: flutter build windows --release --dart-define=version=${{ github.event.inputs.TAG_NAME }}
- name: Prepare for upload
run: |
New-Item -Path . -Name "upload" -ItemType "directory"
Move-Item -Path "./build/windows/x64/runner/Release/" -Destination "./upload/BlueMapGUI_${{ github.event.inputs.TAG_NAME }}_Windows_x64/"
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: "BlueMapGUI_${{ github.event.inputs.TAG_NAME }}_Windows_x64"
path: './upload/'