Skip to content

v0.2.2-dev.10

v0.2.2-dev.10 #39

Workflow file for this run

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