Skip to content

Commit 5978636

Browse files
authored
Merge pull request #2 from Hanprogramer/main
Test release
2 parents 835f49a + 978ba3c commit 5978636

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.github/workflows/build-release.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build and Release
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- test
7+
8+
jobs:
9+
create-release:
10+
name: Create Release
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: release
15+
uses: actions/create-release@v1
16+
id: create_release
17+
with:
18+
release_name: ${{ github.event.title }} #pull request title
19+
tag_name: ${{ github.ref }}
20+
env:
21+
GITHUB_TOKEN: ${{ github.token }}
22+
23+
build-android:
24+
name: Build android
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- uses: actions/checkout@v2
29+
- uses: subosito/flutter-action@v1.5.3
30+
- uses: actions/setup-java@v2
31+
with:
32+
distribution: 'zulu'
33+
java-version: '11'
34+
35+
- name: Install dependencies
36+
run: flutter pub get
37+
38+
- name: Build apk
39+
run: flutter build apk
40+
41+
- name: Upload apk to release
42+
uses: actions/upload-release-asset@v1
43+
env:
44+
GITHUB_TOKEN: ${{ github.token }}
45+
with:
46+
upload_url: ${{ github.jobs.create-release.steps.create_release.outputs.upload_url }}
47+
asset_path: ${{ env.GITHUB_WORKSPACE }}/build/app/outputs/flutter-apk/app-release.apk
48+
asset_name: corecoder_develop_${{ github.ref }}.apk
49+
asset_content_type: application/gzip
50+
build-windows:
51+
name: Build windows
52+
runs-on: windows-latest
53+
steps:
54+
- uses: actions/checkout@v2
55+
- uses: subosito/flutter-action@v1
56+
with:
57+
channel: beta
58+
- name: Install dependencies
59+
run: flutter pub get
60+
- name: Enable windows
61+
run: flutter config --enable-windows-desktop
62+
- name: Build windows
63+
run: flutter build windows
64+
#TODO: upload windows i dont know windows file path help

0 commit comments

Comments
 (0)