mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
205 lines
7.4 KiB
YAML
205 lines
7.4 KiB
YAML
name: Spotube Nightly
|
|
on:
|
|
push:
|
|
branches:
|
|
- build
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build_ubuntu:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: subosito/flutter-action@v2.8.0
|
|
with:
|
|
cache: true
|
|
|
|
- name: Getting current date
|
|
id: date
|
|
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
|
|
|
|
- name: Installing dependencies and configuring version
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y tar clang cmake ninja-build pkg-config libgtk-3-dev make python3-pip python3-setuptools desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev locate patchelf libunwind-dev
|
|
curl -sS https://webi.sh/yq | sh
|
|
yq -i '.version |= sub("\+\d+", "+nightly.")' pubspec.yaml
|
|
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
|
|
flutter config --enable-linux-desktop
|
|
flutter pub get
|
|
|
|
- name: Installing appimagetool
|
|
run: |
|
|
wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
|
|
chmod +x appimagetool
|
|
mv appimagetool /usr/local/bin/
|
|
|
|
- name: Generating Secrets
|
|
run: |
|
|
echo '${{ secrets.DOTENV_NIGHTLY }}' > .env
|
|
dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}'
|
|
|
|
- name: Building Linux application
|
|
# dart pub global activate flutter_distributor
|
|
run: |
|
|
git clone https://github.com/KRTirtho/flutter_distributor.git flutter_distributor
|
|
flutter pub global activate melos 2.9.0
|
|
cd flutter_distributor
|
|
melos bootstrap
|
|
cd ..
|
|
dart flutter_distributor/packages/flutter_distributor/bin/main.dart package --platform=linux --targets=deb,appimage,rpm --skip-clean
|
|
make tar
|
|
mv build/Spotube-linux-x86_64.tar.xz dist/Spotube-linux-x86_64-nightly.tar.xz
|
|
mv dist/**/spotube-*-linux.deb dist/Spotube-linux-x86_64-nightly.deb
|
|
mv dist/**/spotube-*-linux.rpm dist/Spotube-linux-x86_64-nightly.rpm
|
|
mv dist/**/spotube-*-linux.AppImage dist/Spotube-linux-x86_64-nightly.AppImage
|
|
|
|
- name: Uploading binaries to release
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file_glob: true
|
|
file: dist/*
|
|
tag: refs/tags/nightly
|
|
body: |
|
|
## nightly-${{ github.run_number }}
|
|
Nightly build no. ${{ github.run_number }} of Spotube
|
|
overwrite: true
|
|
|
|
- name: Setting up upterm session
|
|
if: ${{ failure() }}
|
|
uses: lhotari/action-upterm@v1
|
|
with:
|
|
limit-access-to-actor: true
|
|
|
|
build_android:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: subosito/flutter-action@v2.8.0
|
|
with:
|
|
cache: true
|
|
|
|
- name: Installing dependencies and configuring version
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev make python3-pip python3-setuptools desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse
|
|
curl -sS https://webi.sh/yq | sh
|
|
yq -i '.version |= sub("\+\d+", "+nightly.")' pubspec.yaml
|
|
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
|
|
flutter pub get
|
|
|
|
- name: Generating Secrets and key store
|
|
run: |
|
|
echo '${{ secrets.DOTENV_NIGHTLY }}' > .env
|
|
dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}'
|
|
echo '${{ secrets.KEYSTORE }}' | base64 --decode > android/app/upload-keystore.jks
|
|
echo '${{ secrets.KEY_PROPERTIES }}' > android/key.properties
|
|
|
|
- name: Building Android apk
|
|
run: |
|
|
flutter build apk
|
|
mv build/app/outputs/apk/release/app-release.apk build/Spotube-android-all-arch-nightly.apk
|
|
|
|
- name: Uploading binaries to release
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: build/Spotube-android-all-arch-nightly.apk
|
|
tag: refs/tags/nightly
|
|
body: |
|
|
## nightly-${{ github.run_number }}
|
|
Nightly build no. ${{ github.run_number }} of Spotube
|
|
overwrite: true
|
|
|
|
- name: Setting up upterm session
|
|
if: ${{ failure() }}
|
|
uses: lhotari/action-upterm@v1
|
|
with:
|
|
limit-access-to-actor: true
|
|
|
|
build_windows:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: subosito/flutter-action@v2.8.0
|
|
with:
|
|
cache: true
|
|
|
|
- name: Installing dependencies and configuring versions
|
|
run: |
|
|
choco install sed make yq -y
|
|
yq -i '.version |= sub("\+\d+", "+nightly.")' pubspec.yaml
|
|
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
|
|
sed -i "s/%{{SPOTUBE_VERSION}}%/${{ github.run_number }}/" windows/runner/Runner.rc
|
|
flutter config --enable-windows-desktop
|
|
flutter pub get
|
|
|
|
- name: Generating Secrets
|
|
run: |
|
|
echo '${{ secrets.DOTENV_NIGHTLY }}' > .env
|
|
dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}'
|
|
|
|
- name: Building for Windows x64
|
|
run: |
|
|
dart pub global activate flutter_distributor
|
|
make innoinstall
|
|
flutter_distributor package --platform=windows --targets=exe --skip-clean
|
|
mv dist/**/spotube-*-windows-setup.exe dist/Spotube-windows-x86_64-setup-nightly.exe
|
|
|
|
- name: Uploading binaries to release
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file_glob: true
|
|
file: dist/*
|
|
tag: refs/tags/nightly
|
|
body: |
|
|
## nightly-${{ github.run_number }}
|
|
Nightly build no. ${{ github.run_number }} of Spotube
|
|
overwrite: true
|
|
|
|
build_macos:
|
|
runs-on: macos-11
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: subosito/flutter-action@v2.8.0
|
|
with:
|
|
cache: true
|
|
|
|
- name: Installing dependencies and configuring versions
|
|
run: |
|
|
brew install yq
|
|
yq -i '.version |= sub("\+\d+", "+nightly.")' pubspec.yaml
|
|
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
|
|
flutter config --enable-macos-desktop
|
|
flutter pub get
|
|
|
|
- name: Generating Secrets
|
|
run: |
|
|
echo '${{ secrets.DOTENV_NIGHTLY }}' > .env
|
|
dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}'
|
|
|
|
- name: Building for MacOS
|
|
run: |
|
|
flutter build macos
|
|
npm install -g appdmg
|
|
appdmg appdmg.json build/Spotube-macos-x86_64-nightly.dmg
|
|
|
|
- name: Uploading binaries to release
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: build/Spotube-macos-x86_64-nightly.dmg
|
|
tag: refs/tags/nightly
|
|
body: |
|
|
## nightly-${{ github.run_number }}
|
|
Nightly build no. ${{ github.run_number }} of Spotube
|
|
overwrite: true
|
|
|
|
- name: Setting up upterm session
|
|
if: ${{ failure() }}
|
|
uses: lhotari/action-upterm@v1
|
|
with:
|
|
limit-access-to-actor: true
|