-
-
Notifications
You must be signed in to change notification settings - Fork 1
168 lines (148 loc) · 5.45 KB
/
release.yaml
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: Database Universe release
on:
workflow_dispatch:
inputs:
database_universe_version:
description: "Database Universe Example: 0.0.1"
required: false
default: ""
is_publish_to_pub_dev:
description: "yes or no"
required: false
default: "yes"
env: # Global variables
VERSION: "0.0.0-placeholder"
jobs:
build_binaries:
name: Build Binaries
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
artifact_name: libdatabase_universe_android_arm64.so
script: build_android.sh
- os: macos-latest
artifact_name: libdatabase_universe_android_armv7.so
script: build_android.sh armv7
- os: macos-latest
artifact_name: libdatabase_universe_android_x64.so
script: build_android.sh x64
- os: macos-latest
artifact_name: database_universe_ios.xcframework.zip
script: build_ios.sh
- os: ubuntu-24.04
artifact_name: libdatabase_universe_linux_x64.so
script: build_linux.sh x64
- os: macos-latest
artifact_name: libdatabase_universe_macos.dylib
script: build_macos.sh
- os: windows-latest
artifact_name: database_universe_windows_x64.dll
script: build_windows.sh x64
- os: ubuntu-latest
artifact_name: database_universe.wasm
script: build_wasm.sh
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Check and Set Global Env
if: ${{ github.event.inputs.database_universe_version != '' }}
run: echo "VERSION=${{ github.event.inputs.database_universe_version }}" >> $GITHUB_ENV
- name: Set Isar Version
run: |
echo "DATABASE_UNIVERSE_VERSION=$VERSION" >> $GITHUB_ENV
echo "DATABASE_UNIVERSE_VERSION=$VERSION"
- name: Build binary
run: bash tool/${{ matrix.script }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact_name }}
path: |
${{ matrix.artifact_name }}
- name: Upload Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.TOKEN_GITHUB }}
file: ${{ matrix.artifact_name }}
asset_name: ${{ matrix.artifact_name }}
tag: "${{ github.ref }}-${{env.VERSION}}"
overwrite: true
publish:
name: Publish
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- uses: actions/setup-node@v3
with:
node-version: "18"
- name: Wait for tests to succeed
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
running-workflow-name: "Publish"
repo-token: ${{ secrets.TOKEN_GITHUB }}
wait-interval: 10
- name: Check and Set Global Env
if: ${{ github.event.inputs.database_universe_version != '' }}
run: echo "VERSION=${{ github.event.inputs.database_universe_version }}" >> $GITHUB_ENV
- name: Set Isar Version
run: |
echo "DATABASE_UNIVERSE_VERSION=$VERSION" >> $GITHUB_ENV
echo "DATABASE_UNIVERSE_VERSION=$VERSION"
- name: Download Binaries
run: sh tool/download_binaries.sh
- name: Adjust Version
run: find . -type f -exec sed -i "s/0.0.0-placeholder/$VERSION/g" {} +
- name: pub.dev credentials
run: |
mkdir -p $HOME/.config/dart
echo '${{ secrets.PUBDEV_CREDENTIALS }}' >> $HOME/.config/dart/pub-credentials.json
- name: Pub Get database_universe
working-directory: library/database_universe
run: |
dart pub get
dart format .
- name: Pub Get database_universe_flutter_libs
working-directory: library/database_universe_flutter_libs
run: |
flutter pub get
dart format .
- name: Archived
run: |
tar -czvf database_universe.tar.gz library/database_universe/
tar -czvf database_universe_flutter_libs.tar.gz library/database_universe_flutter_libs/
- name: Upload Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.TOKEN_GITHUB }}
file: database_universe.tar.gz
asset_name: database_universe.tar.gz
tag: "${{ github.ref }}-${{env.VERSION}}"
overwrite: true
- name: Upload Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.TOKEN_GITHUB }}
file: database_universe_flutter_libs.tar.gz
asset_name: database_universe_flutter_libs.tar.gz
tag: "${{ github.ref }}-${{env.VERSION}}"
overwrite: true
- name: Publish database_universe
if: ${{ github.event.inputs.is_publish_to_pub_dev == 'yes' }}
working-directory: library/database_universe
run: |
dart pub publish --force
- name: Publish database_universe_flutter_libs
if: ${{ github.event.inputs.is_publish_to_pub_dev == 'yes' }}
working-directory: library/database_universe_flutter_libs
run: |
flutter pub publish --force