Skip to content

Commit 6d98489

Browse files
committed
release
0 parents  commit 6d98489

File tree

1 file changed

+146
-0
lines changed

1 file changed

+146
-0
lines changed

.github/workflows/release.yml

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
name: Build Nikawal Packages
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: Bump Version
8+
default: v1.0.0
9+
required: true
10+
11+
jobs:
12+
13+
build-windows-package:
14+
runs-on: windows-latest
15+
16+
steps:
17+
- name: Check out Git repository
18+
uses: actions/checkout@v4
19+
with:
20+
repository: ${{ secrets.NIKAWAL_GITHUB_REPOSITORY }}
21+
token: ${{ secrets.NIKAWAL_GH_PAT }}
22+
- uses: subosito/flutter-action@v2
23+
with:
24+
flutter-version: ${{ vars.FLUTTER_BASE_VERSION }}
25+
channel: 'stable'
26+
cache: true
27+
- name: Build Nikawal
28+
run: |
29+
cd example && flutter build windows --release
30+
- name: Package Nikawal
31+
run: |
32+
pushd "c:\program files (x86)\inno setup 6\Languages"
33+
curl -kLSs https://github.com/kira-96/Inno-Setup-Chinese-Simplified-Translation/raw/main/ChineseSimplified.isl -o ChineseSimplified.isl
34+
popd
35+
iscc .\nikawal_install.iss
36+
- name: Rename Nikawal
37+
shell: bash
38+
run: |
39+
pushd ./Output
40+
mv NikawalSetup.exe NikawalSetup-${{ github.event.inputs.version }}-x86_64.exe
41+
42+
- uses: actions/upload-artifact@v3
43+
with:
44+
name: NikawalSetup-${{ github.event.inputs.version }}-x86_64.exe
45+
path: ./Output/NikawalSetup-${{ github.event.inputs.version }}-x86_64.exe
46+
- uses: softprops/action-gh-release@v2
47+
with:
48+
tag_name: ${{ github.event.inputs.version }}
49+
draft: true
50+
files: Output/NikawalSetup-${{ github.event.inputs.version }}-x86_64.exe
51+
token: ${{ secrets.NIKAWAL_GH_PAT }}
52+
53+
build-android-arm64v8a-package:
54+
runs-on: ubuntu-20.04
55+
steps:
56+
- name: Check out Git repository
57+
uses: actions/checkout@v4
58+
with:
59+
repository: ${{ secrets.NIKAWAL_GITHUB_REPOSITORY }}
60+
token: ${{ secrets.NIKAWAL_GH_PAT }}
61+
- uses: actions/setup-java@v4
62+
with:
63+
distribution: 'zulu'
64+
java-version: '17'
65+
- uses: subosito/flutter-action@v2
66+
with:
67+
flutter-version: ${{ vars.FLUTTER_BASE_VERSION }}
68+
channel: 'stable'
69+
cache: true
70+
- name: Build Nikawal
71+
run: |
72+
cd example
73+
flutter clean && flutter pub get
74+
flutter build apk --release --target-platform android-arm64 --split-per-abi
75+
mv build/app/outputs/flutter-apk/app-arm64-v8a-release.apk ../Nikawal-${{ github.event.inputs.version }}-arm64-v8a.apk
76+
- uses: actions/upload-artifact@v3
77+
with:
78+
name: Nikawal-${{ github.event.inputs.version }}-arm64-v8a.apk
79+
path: Nikawal-${{ github.event.inputs.version }}-arm64-v8a.apk
80+
- uses: softprops/action-gh-release@v2
81+
with:
82+
tag_name: ${{ github.event.inputs.version }}
83+
draft: true
84+
files: Nikawal-${{ github.event.inputs.version }}-arm64-v8a.apk
85+
token: ${{ secrets.NIKAWAL_GH_PAT }}
86+
87+
build-linux-amd64-deb_rpm-package:
88+
runs-on: ubuntu-20.04
89+
90+
steps:
91+
- name: Check out Git repository
92+
uses: actions/checkout@v4
93+
with:
94+
repository: ${{ secrets.NIKAWAL_GITHUB_REPOSITORY }}
95+
token: ${{ secrets.NIKAWAL_GH_PAT }}
96+
- uses: subosito/flutter-action@v2
97+
with:
98+
flutter-version: ${{ vars.FLUTTER_BASE_VERSION }}
99+
channel: 'stable'
100+
cache: true
101+
- name: install dependencies
102+
run: sudo apt update -y && sudo apt install -y libayatana-appindicator3-dev ninja-build build-essential rpm libarchive-tools
103+
104+
- name: build linux deb/rpm package
105+
run: |
106+
cd example
107+
flutter build linux --release
108+
cd linux
109+
mkdir -p ./debian/build-src/opt/apps/com.nikawal.nspa.linux/files/lib
110+
pushd ./debian/build-src/opt/apps/com.nikawal.nspa.linux/files || exit
111+
rm -rf ./*
112+
popd || exit
113+
114+
# cp
115+
cp -r ../build/linux/x64/release/bundle/* ./debian/build-src/opt/apps/com.nikawal.nspa.linux/files
116+
117+
echo "build deb package"
118+
pushd ./debian || exit
119+
120+
dpkg -b ./build-src com.nikawal.nspa.linux.deb
121+
122+
popd || exit
123+
124+
echo "build rpm package"
125+
NIKAWAL_SRC=`pwd` rpmbuild -bb ./rpm.spec
126+
127+
- name: Rename deb package
128+
run: |
129+
mv ./example/linux/debian/com.nikawal.nspa.linux.deb ./example/linux/debian/com.nikawal.nspa.linux-${{ github.event.inputs.version }}-x86_64.deb
130+
mv ~/rpmbuild/RPMS/x86_64/Nikawal*.rpm ./example/linux/debian/com.nikawal.nspa.linux-${{ github.event.inputs.version }}-x86_64.rpm
131+
- uses: actions/upload-artifact@v3
132+
with:
133+
name: com.nikawal.nspa.linux-${{ github.event.inputs.version }}-x86_64.deb
134+
path: ./example/linux/debian/com.nikawal.nspa.linux-${{ github.event.inputs.version }}-x86_64.deb
135+
- uses: actions/upload-artifact@v3
136+
with:
137+
name: com.nikawal.nspa.linux-${{ github.event.inputs.version }}-x86_64.rpm
138+
path: ./example/linux/debian/com.nikawal.nspa.linux-${{ github.event.inputs.version }}-x86_64.rpm
139+
- uses: softprops/action-gh-release@v2
140+
with:
141+
tag_name: ${{ github.event.inputs.version }}
142+
draft: true
143+
files: |
144+
./example/linux/debian/com.nikawal.nspa.linux-${{ github.event.inputs.version }}-x86_64.deb
145+
./example/linux/debian/com.nikawal.nspa.linux-${{ github.event.inputs.version }}-x86_64.rpm
146+
token: ${{ secrets.NIKAWAL_GH_PAT }}

0 commit comments

Comments
 (0)