-
Notifications
You must be signed in to change notification settings - Fork 1
129 lines (112 loc) · 3.95 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
name: build release file
on:
release:
types: [ prereleased, released ]
env:
APP_NAME: Waiter
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
# https://github.com/subosito/flutter-action/issues/277
- uses: subosito/[email protected]
with:
channel: 'stable'
- name: Build
run: |
flutter pub get
flutter build windows --build-name=$GITHUB_REF_NAME --build-number=$GITHUB_RUN_NUMBER
Compress-Archive -Path .\build\windows\x64\runner\Release\* -DestinationPath ${{ env.APP_NAME }}-windows-${{ github.ref_name }}.zip
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ env.APP_NAME }}-windows-${{ github.ref_name }}.zip
- uses: actions/upload-artifact@v4
with:
name: windows
path: ${{ env.APP_NAME }}-windows-${{ github.ref_name }}.zip
build-web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Build
run: |
flutter pub get
flutter build web --build-name=$GITHUB_REF_NAME --build-number=$GITHUB_RUN_NUMBER
cd build/web && tar -zcvf ../../${{ env.APP_NAME }}-web-${{ github.ref_name }}.tar.gz ./*
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ env.APP_NAME }}-web-${{ github.ref_name }}.tar.gz
- uses: actions/upload-artifact@v4
with:
name: web
path: ${{ env.APP_NAME }}-web-${{ github.ref_name }}.tar.gz
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Build
run: |
flutter pub get
flutter build apk --build-name=$GITHUB_REF_NAME --build-number=$GITHUB_RUN_NUMBER
mv ./build/app/outputs/flutter-apk/app-release.apk ${{ env.APP_NAME }}-${{ github.ref_name }}.apk
mv ./build/app/outputs/flutter-apk/app-release.apk.sha1 ${{ env.APP_NAME }}-${{ github.ref_name }}.apk.sha1
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ env.APP_NAME }}-${{ github.ref_name }}.apk
${{ env.APP_NAME }}-${{ github.ref_name }}.apk.sha1
- uses: actions/upload-artifact@v4
with:
name: android
path: ${{ env.APP_NAME }}-${{ github.ref_name }}.apk
build-docker:
runs-on: ubuntu-latest
needs: [build-windows, build-web, build-android]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: docker
- name: Display structure of downloaded files
run: ls -R docker
- name: Extract web file
run: |
mkdir ./docker/web
tar -zxvf ./docker/${{ env.APP_NAME }}-web-${{ github.ref_name }}.tar.gz -C ./docker/web
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: ./docker
file: ./docker/Dockerfile
push: true
tags: ghcr.io/tuihub/waiter:${{ github.ref_name }}
build-args: |
WEB_FILE=web/
WIN_FILE_NAME=${{ env.APP_NAME }}-windows-${{ github.ref_name }}.zip
AND_FILE_NAME=${{ env.APP_NAME }}-${{ github.ref_name }}.apk