-
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (79 loc) · 2.79 KB
/
build-release.yml
File metadata and controls
90 lines (79 loc) · 2.79 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
name: Build and Release
on:
pull_request:
branches:
- main
types:
- closed
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Create short commit SHA
id: create_short_sha
run: echo "::set-output name=sha_short::$(echo ${{ github.event.pull_request.head.sha }} | cut -c1-8))"
- name: release
uses: actions/create-release@v1
id: create_release
with:
release_name: ${{ github.event.pull_request.title }} #pull request title
body: ${{ github.event.pull_request.body }}
tag_name: ${{ github.event.pull_request.title }}
env:
GITHUB_TOKEN: ${{ github.token }}
- id: step_upload_url
run: echo "::set-output name=upload_url::${{ steps.create_release.outputs.upload_url }}"
outputs:
upload_url: ${{ steps.step_upload_url.outputs.upload_url }}
sha_short: ${{ steps.create_short_sha.outputs.sha_short }}
build-android:
name: Build android and upload
runs-on: ubuntu-latest
needs: create-release
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1.5.3
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- name: Install dependencies
run: flutter pub get
- name: Build apk
run: flutter build apk
- name: Upload apk to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/build/app/outputs/flutter-apk/app-release.apk
asset_name: corecoder_develop_android.apk
asset_content_type: application/gzip
build-windows:
name: Build windows and upload
runs-on: windows-latest
needs: create-release
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: beta
- name: Install dependencies
run: flutter pub get
- name: Enable windows
run: flutter config --enable-windows-desktop
- name: Build windows
run: flutter build windows
- name: Zip windows build
run: powershell Compress-Archive -DestinationPath ${{ github.workspace }}/windows_build.zip -Path ${{ github.workspace }}/build/windows/runner/Release/*
- name: Upload windows build to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/windows_build.zip
asset_name: corecoder_develop_windows.zip
asset_content_type: application/gzip