version: 0.12.2 #91
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
workflow_dispatch: | |
branches: [ main ] | |
jobs: | |
build_android: | |
needs: release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
cache: 'gradle' | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.16.0' | |
channel: 'stable' | |
cache: true | |
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache | |
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path | |
architecture: x64 # optional, x64 or arm64 | |
- name: 🔐 Retrieve base64 keystore and decode it to a file | |
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > "${{ github.workspace }}/android-keystore.jks" | |
- name: 📝🔐 Create key.properties file | |
env: | |
KEYSTORE_PROPERTIES_PATH: ${{ github.workspace }}/android/key.properties | |
run: | | |
echo 'storeFile=${{ github.workspace }}/android-keystore.jks' > $KEYSTORE_PROPERTIES_PATH | |
echo 'keyAlias=${{ secrets.KEYSTORE_KEY_ALIAS }}' >> $KEYSTORE_PROPERTIES_PATH | |
echo 'storePassword=${{ secrets.KEYSTORE_PASSWORD }}' >> $KEYSTORE_PROPERTIES_PATH | |
echo 'keyPassword=${{ secrets.KEYSTORE_KEY_PASSWORD }}' >> $KEYSTORE_PROPERTIES_PATH | |
- name: pub get | |
run: flutter pub get | |
- name: build apk-split | |
run: flutter build apk --split-per-abi | |
- name: build apk | |
run: flutter build apk | |
# APK | |
- name: Upload APK to release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload_url }} | |
asset_path: build/app/outputs/flutter-apk/app-release.apk | |
asset_name: yana-${{ github.ref_name }}-android-universal.apk | |
asset_content_type: application/zip | |
- name: Upload APK to release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload_url }} | |
asset_path: build/app/outputs/flutter-apk/app-arm64-v8a-release.apk | |
asset_name: yana-${{ github.ref_name }}-android-arm64-v8a.apk | |
asset_content_type: application/zip | |
- name: Upload APK to release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload_url }} | |
asset_path: build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk | |
asset_name: yana-${{ github.ref_name }}-android-armeabi-v7a.apk | |
asset_content_type: application/zip | |
- name: Upload APK to release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload_url }} | |
asset_path: build/app/outputs/flutter-apk/app-x86_64-release.apk | |
asset_name: yana-${{ github.ref_name }}-android-x86_64.apk | |
asset_content_type: application/zip | |
# - name: flutter build appbundle | |
# run: flutter build appbundle | |
build_linux: | |
needs: release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
cache: 'gradle' | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.16.0' | |
channel: 'stable' | |
cache: true | |
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache | |
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path | |
architecture: x64 # optional, x64 or arm64 | |
- run: | | |
sudo apt-get update -y | |
sudo apt-get install -y ninja-build libgtk-3-dev libfuse2 libsecret-1-dev libjsoncpp-dev libsecret-1-0 libsecret-tools | |
- run: flutter config --enable-linux-desktop | |
- run: flutter pub get | |
- run: flutter build linux | |
- run: dart pub global activate flutter_distributor | |
- run: flutter_distributor package --platform linux --targets deb | |
- run: cp dist/*/*.deb yana-${{ github.ref_name }}-linux-x86_64.deb | |
#- run: flutter_distributor package --platform linux --targets appimage | |
- run: wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage | |
- run: chmod +x appimagetool-x86_64.AppImage | |
- run: cp -r build/linux/x64/release/bundle/* Yana.AppDir/ | |
- run: cp -r assets/imgs/logo/logo-new.png Yana.AppDir/logo.png | |
- run: ./appimagetool-x86_64.AppImage Yana.AppDir/ | |
# LINUX APPIMAGE | |
- name: Upload appImage to release | |
id: upload-release-asset-appimage | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload_url }} | |
asset_path: Yana-x86_64.AppImage | |
asset_name: yana-${{ github.ref_name }}-linux-x86_64-.AppImage | |
asset_content_type: application/zip | |
# LINUX DEB | |
- name: Upload deb to release | |
id: upload-release-asset-deb | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload_url }} | |
asset_path: yana-${{ github.ref_name }}-linux-x86_64.deb | |
asset_name: yana-${{ github.ref_name }}-linux-x86_64.deb | |
asset_content_type: application/zip | |
# build_linux: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - uses: actions/setup-java@v2 | |
# with: | |
# distribution: 'zulu' | |
# java-version: '17' | |
# cache: 'gradle' | |
# - uses: subosito/flutter-action@v2 | |
# with: | |
# flutter-version: '3.13.0' | |
# channel: 'stable' | |
# cache: true | |
# cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache | |
# cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path | |
# architecture: x64 # optional, x64 or arm64 | |
# - run: | | |
# sudo apt-get update -y | |
# sudo apt-get install -y ninja-build libgtk-3-dev libfuse2 libsecret-1-dev libjsoncpp-dev libsecret-1-0 libsecret-tools | |
# - run: flutter config --enable-linux-desktop | |
# - run: flutter pub get | |
# # - run: flutter test | |
# - run: flutter build linux | |
# - run: wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage | |
# - run: chmod +x appimagetool-x86_64.AppImage | |
# - run: cp -r build/linux/x64/release/bundle/* Yana.AppDir/ | |
# - run: cp -r assets/imgs/logo/logo.png Yana.AppDir/ | |
# - run: ./appimagetool-x86_64.AppImage Yana.AppDir/ | |
# - name: 'Artifact' | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: Yana-x86_64.AppImage | |
# path: Yana-x86_64.AppImage | |
# | |
release: | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
id: ${{ steps.create_release.outputs.id }} | |
steps: | |
# Create Release | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
body: | | |
------ | |
Verify the signature of the .apk file: | |
`keytool -printcert -jarfile <.apk-file> |grep SHA256` | |
Compare this with the SHA256 found on nostr profile for [Yana](https://njump.me/npub1gp4xzpmluelsakjtayc4wtzj97fhj5kakqjvsannu00xkdlf4x8s0xdqyq) | |
release_name: Release ${{ github.ref }} | |
draft: true | |
# prerelease: true | |
publish-release: | |
needs: [release,build_android,build_linux] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: eregon/publish-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
release_id: ${{ needs.release.outputs.id }} | |
dockerimage: | |
name: Push Docker image to Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | |
with: | |
images: fmar/yana | |
- name: Build and push Docker image | |
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
#LINUX -> flutter_distributor package --platform linux --targets appimage |