Skip to content

Commit fb20304

Browse files
authored
[ci] Create a release after build (#250)
* Simplify expressions in build.yml * Add the release job
1 parent 5dbdf9c commit fb20304

File tree

2 files changed

+46
-8
lines changed

2 files changed

+46
-8
lines changed

.github/workflows/build.yml

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
ninja -C src/out/$OUTPUT_NAME tizen
8686
8787
# Build unittests.
88-
if [[ "$OUTPUT_NAME" == "linux_release_arm" ]]; then
88+
if [ "$OUTPUT_NAME" = "linux_release_arm" ]; then
8989
ninja -C src/out/$OUTPUT_NAME flutter_tizen_unittests
9090
fi
9191
@@ -113,7 +113,7 @@ jobs:
113113
!src/out/linux_release_arm/cpp_client_wrapper/engine_method_result.cc
114114
115115
- uses: actions/upload-artifact@v2
116-
if: (matrix.arch == 'arm' || matrix.arch == 'arm64') && (matrix.mode == 'release' || matrix.mode == 'profile')
116+
if: (matrix.arch == 'arm' || matrix.arch == 'arm64') && matrix.mode != 'debug'
117117
with:
118118
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_linux-x64
119119
path: src/out/${{ env.OUTPUT_NAME }}/clang_x64/gen_snapshot
@@ -126,6 +126,9 @@ jobs:
126126
arch: [arm, arm64]
127127
mode: [release, profile]
128128

129+
env:
130+
OUTPUT_NAME: linux_${{ matrix.mode }}_${{ matrix.arch }}
131+
129132
steps:
130133
- name: checkout engine
131134
run: |
@@ -165,12 +168,12 @@ jobs:
165168
--linux --linux-cpu=${{ matrix.arch }} `
166169
--runtime-mode=${{ matrix.mode }} `
167170
--no-goma
168-
ninja -C .\out\linux_${{ matrix.mode }}_${{ matrix.arch }} gen_snapshot
171+
ninja -C .\out\${{ env.OUTPUT_NAME }} gen_snapshot
169172
170173
- uses: actions/upload-artifact@v2
171174
with:
172175
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_windows-x64
173-
path: C:\workspace\engine\src\out\linux_${{ matrix.mode }}_${{ matrix.arch }}\gen_snapshot.exe
176+
path: C:\workspace\engine\src\out\${{ env.OUTPUT_NAME }}\gen_snapshot.exe
174177

175178
macos-build:
176179
runs-on: macos-11
@@ -233,7 +236,7 @@ jobs:
233236
- uses: actions/upload-artifact@v2
234237
with:
235238
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_darwin-x64
236-
path: src/out/linux_${{ matrix.mode }}_${{ matrix.arch }}/clang_x64/gen_snapshot
239+
path: src/out/${{ env.OUTPUT_NAME }}/clang_x64/gen_snapshot
237240

238241
test:
239242
needs: build
@@ -260,3 +263,36 @@ jobs:
260263
run: |
261264
chmod +x flutter_tizen_unittests
262265
docker run --rm -t -v `pwd`:/root ${IMAGE_TAG} /root/flutter_tizen_unittests
266+
267+
release:
268+
needs: [windows-build, macos-build, test]
269+
if: github.event_name == 'push'
270+
runs-on: ubuntu-latest
271+
272+
steps:
273+
- uses: actions/checkout@v2
274+
275+
- uses: actions/download-artifact@v2
276+
277+
- name: create archives
278+
run: |
279+
rm -r *-unittests
280+
for name in tizen-*; do
281+
7z a $name.zip ./$name/*
282+
done
283+
284+
- name: set variables
285+
run: |
286+
echo "TAG_NAME=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV
287+
echo "VERSION=$(echo "${{ github.ref_name }}" | cut -d'-' -f2)" >> $GITHUB_ENV
288+
289+
- uses: softprops/action-gh-release@v1
290+
with:
291+
name: ${{ env.VERSION }} (${{ env.TAG_NAME }})
292+
tag_name: ${{ env.TAG_NAME }}
293+
target_commitish: ${{ github.ref_name }}
294+
files: tizen-*.zip
295+
body: |
296+
Flutter engine ${{ env.VERSION }} for Tizen
297+
298+
https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

.github/workflows/check-symbol.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ name: Check Symbols
22

33
on:
44
workflow_run:
5-
workflows: ["Build"]
5+
workflows:
6+
- Build
67
types:
78
- completed
89

910
jobs:
1011
check:
1112
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1213
runs-on: ubuntu-latest
14+
1315
steps:
1416
- uses: actions/checkout@v2
1517
- uses: actions/checkout@v2
@@ -43,7 +45,7 @@ jobs:
4345
owner: context.repo.owner,
4446
repo: context.repo.repo,
4547
sha: context.payload.workflow_run.head_sha,
46-
context: "Check Symbols",
48+
context: 'Check Symbols',
4749
state: 'success',
4850
description: 'All symbols are valid'
4951
});
@@ -57,7 +59,7 @@ jobs:
5759
owner: context.repo.owner,
5860
repo: context.repo.repo,
5961
sha: context.payload.workflow_run.head_sha,
60-
context: "Check Symbols",
62+
context: 'Check Symbols',
6163
state: 'failure',
6264
description: 'Failed in checking symbols',
6365
target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}',

0 commit comments

Comments
 (0)