mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-12-09 08:47:31 +00:00
cd: replace release binary
This commit is contained in:
parent
0cc1a97914
commit
df21468c03
153
.github/workflows/build_packages.yml
vendored
153
.github/workflows/build_packages.yml
vendored
@ -1,153 +0,0 @@
|
|||||||
name: Build Packages
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
debug:
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
description: Debug with SSH toggle
|
|
||||||
required: false
|
|
||||||
channel:
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- stable
|
|
||||||
- nightly
|
|
||||||
default: nightly
|
|
||||||
description: The release channel
|
|
||||||
dry_run:
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
description: Dry run without uploading to release
|
|
||||||
|
|
||||||
env:
|
|
||||||
FLUTTER_VERSION: 3.19.5
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build_platform:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
platform: linux
|
|
||||||
files: |
|
|
||||||
dist/Spotube-linux-x86_64.deb
|
|
||||||
dist/Spotube-linux-x86_64.rpm
|
|
||||||
dist/spotube-linux-*-x86_64.tar.xz
|
|
||||||
- os: ubuntu-latest
|
|
||||||
platform: android
|
|
||||||
files: |
|
|
||||||
build/Spotube-android-all-arch.apk
|
|
||||||
build/Spotube-playstore-all-arch.aab
|
|
||||||
- os: windows-latest
|
|
||||||
platform: windows
|
|
||||||
files: |
|
|
||||||
dist/Spotube-windows-x86_64.nupkg
|
|
||||||
dist/Spotube-windows-x86_64-setup.exe
|
|
||||||
- os: macos-latest
|
|
||||||
platform: ios
|
|
||||||
files: |
|
|
||||||
Spotube-iOS.ipa
|
|
||||||
- os: macos-14
|
|
||||||
platform: macos
|
|
||||||
files: |
|
|
||||||
build/Spotube-macos-universal.dmg
|
|
||||||
build/Spotube-macos-universal.pkg
|
|
||||||
runs-on: ${{matrix.os}}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: subosito/flutter-action@v2.12.0
|
|
||||||
with:
|
|
||||||
cache: true
|
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
|
||||||
- name: Setup Java
|
|
||||||
if: ${{matrix.platform == 'android'}}
|
|
||||||
uses: actions/setup-java@v4
|
|
||||||
with:
|
|
||||||
distribution: 'zulu'
|
|
||||||
java-version: '17'
|
|
||||||
cache: 'gradle'
|
|
||||||
check-latest: true
|
|
||||||
|
|
||||||
- name: Install ${{matrix.platform}} dependencies
|
|
||||||
run: dart cli/cli.dart install-dependencies --platform=${{matrix.platform}}
|
|
||||||
|
|
||||||
- name: Sign Apk
|
|
||||||
if: ${{matrix.platform == 'android'}}
|
|
||||||
run: |
|
|
||||||
echo '${{ secrets.KEYSTORE }}' | base64 --decode > android/app/upload-keystore.jks
|
|
||||||
echo '${{ secrets.KEY_PROPERTIES }}' > android/key.properties
|
|
||||||
|
|
||||||
- name: Build ${{matrix.platform}} binaries
|
|
||||||
run: dart cli/cli.dart build ${{matrix.platform}}
|
|
||||||
env:
|
|
||||||
CHANNEL: ${{inputs.channel}}
|
|
||||||
DOTENV: ${{secrets.DOTENV_RELEASE}}
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
if-no-files-found: error
|
|
||||||
name: Spotube-Release-Binaries
|
|
||||||
path: ${{matrix.files}}
|
|
||||||
|
|
||||||
- name: Debug With SSH When fails
|
|
||||||
if: ${{ failure() && inputs.debug && inputs.channel == 'nightly' }}
|
|
||||||
uses: mxschmitt/action-tmate@v3
|
|
||||||
with:
|
|
||||||
limit-access-to-actor: true
|
|
||||||
|
|
||||||
upload:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs:
|
|
||||||
- build_platform
|
|
||||||
steps:
|
|
||||||
- uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: Spotube-Release-Binaries
|
|
||||||
path: ./Spotube-Release-Binaries
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: sudo apt-get install tree -y
|
|
||||||
|
|
||||||
- name: Generate Checksums
|
|
||||||
run: |
|
|
||||||
tree .
|
|
||||||
md5sum Spotube-Release-Binaries/* >> RELEASE.md5sum
|
|
||||||
sha256sum Spotube-Release-Binaries/* >> RELEASE.sha256sum
|
|
||||||
sed -i 's|Spotube-Release-Binaries/||' RELEASE.sha256sum RELEASE.md5sum
|
|
||||||
|
|
||||||
- name: Extract pubspec version
|
|
||||||
run: |
|
|
||||||
echo "PUBSPEC_VERSION=$(grep -oP 'version:\s*\K[^+]+(?=\+)' pubspec.yaml)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
if-no-files-found: error
|
|
||||||
name: Spotube-Release-Binaries
|
|
||||||
path: |
|
|
||||||
RELEASE.md5sum
|
|
||||||
RELEASE.sha256sum
|
|
||||||
|
|
||||||
- name: Upload Release Binaries (stable)
|
|
||||||
if: ${{ !inputs.dry_run && inputs.channel == 'stable' }}
|
|
||||||
uses: ncipollo/release-action@v1
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
tag: v${{ env.PUBSPEC_VERSION }} # mind the "v" prefix
|
|
||||||
omitBodyDuringUpdate: true
|
|
||||||
omitNameDuringUpdate: true
|
|
||||||
omitPrereleaseDuringUpdate: true
|
|
||||||
allowUpdates: true
|
|
||||||
artifacts: Spotube-Release-Binaries/*,RELEASE.sha256sum,RELEASE.md5sum
|
|
||||||
|
|
||||||
- name: Upload Release Binaries (nightly)
|
|
||||||
if: ${{ !inputs.dry_run && inputs.channel == 'nightly' }}
|
|
||||||
uses: ncipollo/release-action@v1
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
tag: nightly
|
|
||||||
omitBodyDuringUpdate: true
|
|
||||||
omitNameDuringUpdate: true
|
|
||||||
omitPrereleaseDuringUpdate: true
|
|
||||||
allowUpdates: true
|
|
||||||
artifacts: Spotube-Release-Binaries/*,RELEASE.sha256sum,RELEASE.md5sum
|
|
||||||
body: 'Build Number: ${{github.run_number}}'
|
|
||||||
512
.github/workflows/spotube-release-binary.yml
vendored
512
.github/workflows/spotube-release-binary.yml
vendored
@ -2,295 +2,57 @@ name: Spotube Release Binary
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
debug:
|
||||||
description: Version to release (x.x.x)
|
type: boolean
|
||||||
default: 3.6.0
|
default: false
|
||||||
required: true
|
description: Debug with SSH toggle
|
||||||
|
required: false
|
||||||
channel:
|
channel:
|
||||||
type: choice
|
type: choice
|
||||||
description: Release Channel
|
|
||||||
required: true
|
|
||||||
options:
|
options:
|
||||||
- stable
|
- stable
|
||||||
- nightly
|
- nightly
|
||||||
default: nightly
|
default: nightly
|
||||||
debug:
|
description: The release channel
|
||||||
description: Debug on failed when channel is nightly
|
dry_run:
|
||||||
required: true
|
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
dry_run:
|
description: Dry run without uploading to release
|
||||||
description: Dry run
|
|
||||||
required: true
|
|
||||||
type: boolean
|
|
||||||
default: true
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
FLUTTER_VERSION: '3.19.5'
|
FLUTTER_VERSION: 3.19.5
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
windows:
|
build_platform:
|
||||||
runs-on: windows-latest
|
strategy:
|
||||||
steps:
|
matrix:
|
||||||
- uses: actions/checkout@v4
|
include:
|
||||||
- uses: subosito/flutter-action@v2.12.0
|
- os: ubuntu-latest
|
||||||
with:
|
platform: linux
|
||||||
cache: true
|
files: |
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
dist/Spotube-linux-x86_64.deb
|
||||||
|
dist/Spotube-linux-x86_64.rpm
|
||||||
- name: Replace pubspec version and BUILD_VERSION Env (nightly)
|
dist/spotube-linux-*-x86_64.tar.xz
|
||||||
if: ${{ inputs.channel == 'nightly' }}
|
- os: ubuntu-latest
|
||||||
run: |
|
platform: android
|
||||||
choco install sed make yq -y
|
files: |
|
||||||
yq -i '.version |= sub("\+\d+", "-${{ inputs.channel }}+")' pubspec.yaml
|
build/Spotube-android-all-arch.apk
|
||||||
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
|
build/Spotube-playstore-all-arch.aab
|
||||||
echo "BUILD_VERSION=${{ inputs.version }}+${{ inputs.channel }}.${{ github.run_number }}" >> $GITHUB_ENV
|
- os: windows-latest
|
||||||
shell: bash
|
platform: windows
|
||||||
|
files: |
|
||||||
- name: BUILD_VERSION Env (stable)
|
dist/Spotube-windows-x86_64.nupkg
|
||||||
if: ${{ inputs.channel == 'stable' }}
|
dist/Spotube-windows-x86_64-setup.exe
|
||||||
run: |
|
- os: macos-latest
|
||||||
"BUILD_VERSION=${{ inputs.version }}" >> $env:GITHUB_ENV
|
platform: ios
|
||||||
|
files: |
|
||||||
- name: Replace version in files
|
Spotube-iOS.ipa
|
||||||
run: |
|
- os: macos-14
|
||||||
choco install sed make -y
|
platform: macos
|
||||||
sed -i "s/%{{SPOTUBE_VERSION}}%/${{ env.BUILD_VERSION }}/" choco-struct/tools/VERIFICATION.txt
|
files: |
|
||||||
sed -i "s/%{{SPOTUBE_VERSION}}%/${{ env.BUILD_VERSION }}/" choco-struct/spotube.nuspec
|
build/Spotube-macos-universal.dmg
|
||||||
|
build/Spotube-macos-universal.pkg
|
||||||
- name: Create Stable .env
|
runs-on: ${{matrix.os}}
|
||||||
if: ${{ inputs.channel == 'stable' }}
|
|
||||||
run: echo '${{ secrets.DOTENV_RELEASE }}' > .env
|
|
||||||
|
|
||||||
- name: Create Nightly .env
|
|
||||||
if: ${{ inputs.channel == 'nightly' }}
|
|
||||||
run: echo '${{ secrets.DOTENV_NIGHTLY }}' > .env
|
|
||||||
|
|
||||||
- name: Generating Secrets
|
|
||||||
run: |
|
|
||||||
flutter config --enable-windows-desktop
|
|
||||||
flutter pub get
|
|
||||||
dart run build_runner build --delete-conflicting-outputs
|
|
||||||
|
|
||||||
- name: Build Windows Executable
|
|
||||||
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.exe
|
|
||||||
|
|
||||||
- name: Create Chocolatey Package and set hash
|
|
||||||
if: ${{ inputs.channel == 'stable' }}
|
|
||||||
run: |
|
|
||||||
Set-Variable -Name HASH -Value (Get-FileHash dist\Spotube-windows-x86_64-setup.exe).Hash
|
|
||||||
sed -i "s/%{{WIN_SHA256}}%/$HASH/" choco-struct/tools/VERIFICATION.txt
|
|
||||||
make choco
|
|
||||||
mv dist/spotube.*.nupkg dist/Spotube-windows-x86_64.nupkg
|
|
||||||
|
|
||||||
|
|
||||||
- name: Upload Artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
if-no-files-found: error
|
|
||||||
name: Spotube-Release-Binaries
|
|
||||||
path: |
|
|
||||||
dist/Spotube-windows-x86_64.nupkg
|
|
||||||
dist/Spotube-windows-x86_64-setup.exe
|
|
||||||
|
|
||||||
- name: Debug With SSH When fails
|
|
||||||
if: ${{ failure() && inputs.debug && inputs.channel == 'nightly' }}
|
|
||||||
uses: mxschmitt/action-tmate@v3
|
|
||||||
with:
|
|
||||||
limit-access-to-actor: true
|
|
||||||
|
|
||||||
linux:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: subosito/flutter-action@v2.12.0
|
|
||||||
with:
|
|
||||||
cache: true
|
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
|
||||||
|
|
||||||
- name: Get current date
|
|
||||||
id: date
|
|
||||||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
|
||||||
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 libunwind-dev locate patchelf gir1.2-appindicator3-0.1 libappindicator3-1 libappindicator3-dev libsecret-1-0 libjsoncpp25 libsecret-1-dev libjsoncpp-dev libnotify-bin libnotify-dev mpv libmpv-dev
|
|
||||||
|
|
||||||
- name: Install AppImage Tool
|
|
||||||
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: Replace pubspec version and BUILD_VERSION Env (nightly)
|
|
||||||
if: ${{ inputs.channel == 'nightly' }}
|
|
||||||
run: |
|
|
||||||
curl -sS https://webi.sh/yq | sh
|
|
||||||
yq -i '.version |= sub("\+\d+", "+${{ inputs.channel }}.")' pubspec.yaml
|
|
||||||
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
|
|
||||||
echo "BUILD_VERSION=${{ inputs.version }}+${{ inputs.channel }}.${{ github.run_number }}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: BUILD_VERSION Env (stable)
|
|
||||||
if: ${{ inputs.channel == 'stable' }}
|
|
||||||
run: |
|
|
||||||
echo "BUILD_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Create Stable .env
|
|
||||||
if: ${{ inputs.channel == 'stable' }}
|
|
||||||
run: echo '${{ secrets.DOTENV_RELEASE }}' > .env
|
|
||||||
|
|
||||||
- name: Create Nightly .env
|
|
||||||
if: ${{ inputs.channel == 'nightly' }}
|
|
||||||
run: echo '${{ secrets.DOTENV_NIGHTLY }}' > .env
|
|
||||||
|
|
||||||
- name: Replace Version in files
|
|
||||||
run: |
|
|
||||||
sed -i 's|%{{APPDATA_RELEASE}}%|<release version="${{ env.BUILD_VERSION }}" date="${{ steps.date.outputs.date }}" />|' linux/com.github.KRTirtho.Spotube.appdata.xml
|
|
||||||
|
|
||||||
- name: Generate Secrets
|
|
||||||
run: |
|
|
||||||
flutter config --enable-linux-desktop
|
|
||||||
flutter pub get
|
|
||||||
dart run build_runner build --delete-conflicting-outputs
|
|
||||||
|
|
||||||
- name: Build Linux Packages
|
|
||||||
run: |
|
|
||||||
dart pub global activate flutter_distributor
|
|
||||||
alias dpkg-deb="dpkg-deb --Zxz"
|
|
||||||
flutter_distributor package --platform=linux --targets=deb
|
|
||||||
flutter_distributor package --platform=linux --targets=rpm
|
|
||||||
|
|
||||||
- name: Create tar.xz (stable)
|
|
||||||
if: ${{ inputs.channel == 'stable' }}
|
|
||||||
run: make tar VERSION=${{ env.BUILD_VERSION }} ARCH=x64 PKG_ARCH=x86_64
|
|
||||||
|
|
||||||
- name: Create tar.xz (nightly)
|
|
||||||
if: ${{ inputs.channel == 'nightly' }}
|
|
||||||
run: make tar VERSION=nightly ARCH=x64 PKG_ARCH=x86_64
|
|
||||||
|
|
||||||
- name: Move Files to dist
|
|
||||||
run: |
|
|
||||||
mv build/spotube-linux-*-x86_64.tar.xz dist/
|
|
||||||
mv dist/**/spotube-*-linux.deb dist/Spotube-linux-x86_64.deb
|
|
||||||
mv dist/**/spotube-*-linux.rpm dist/Spotube-linux-x86_64.rpm
|
|
||||||
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: ${{ inputs.channel == 'stable' }}
|
|
||||||
with:
|
|
||||||
if-no-files-found: error
|
|
||||||
name: Spotube-Release-Binaries
|
|
||||||
path: |
|
|
||||||
dist/Spotube-linux-x86_64.deb
|
|
||||||
dist/Spotube-linux-x86_64.rpm
|
|
||||||
dist/spotube-linux-${{ env.BUILD_VERSION }}-x86_64.tar.xz
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: ${{ inputs.channel == 'nightly' }}
|
|
||||||
with:
|
|
||||||
if-no-files-found: error
|
|
||||||
name: Spotube-Release-Binaries
|
|
||||||
path: |
|
|
||||||
dist/Spotube-linux-x86_64.deb
|
|
||||||
dist/Spotube-linux-x86_64.rpm
|
|
||||||
dist/spotube-linux-nightly-x86_64.tar.xz
|
|
||||||
|
|
||||||
- name: Debug With SSH When fails
|
|
||||||
if: ${{ failure() && inputs.debug && inputs.channel == 'nightly' }}
|
|
||||||
uses: mxschmitt/action-tmate@v3
|
|
||||||
with:
|
|
||||||
limit-access-to-actor: true
|
|
||||||
|
|
||||||
linux_arm:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Get current date
|
|
||||||
id: date
|
|
||||||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt-get update -y
|
|
||||||
sudo apt-get install -y pkg-config make python3-pip python3-setuptools
|
|
||||||
|
|
||||||
- name: Replace pubspec version and BUILD_VERSION Env (nightly)
|
|
||||||
if: ${{ inputs.channel == 'nightly' }}
|
|
||||||
run: |
|
|
||||||
curl -sS https://webi.sh/yq | sh
|
|
||||||
yq -i '.version |= sub("\+\d+", "+${{ inputs.channel }}.")' pubspec.yaml
|
|
||||||
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
|
|
||||||
echo "BUILD_VERSION=${{ inputs.version }}+${{ inputs.channel }}.${{ github.run_number }}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: BUILD_VERSION Env (stable)
|
|
||||||
if: ${{ inputs.channel == 'stable' }}
|
|
||||||
run: |
|
|
||||||
echo "BUILD_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Create Stable .env
|
|
||||||
if: ${{ inputs.channel == 'stable' }}
|
|
||||||
run: echo '${{ secrets.DOTENV_RELEASE }}' > .env
|
|
||||||
|
|
||||||
- name: Create Nightly .env
|
|
||||||
if: ${{ inputs.channel == 'nightly' }}
|
|
||||||
run: echo '${{ secrets.DOTENV_NIGHTLY }}' > .env
|
|
||||||
|
|
||||||
- name: Replace Version in files
|
|
||||||
run: |
|
|
||||||
sed -i 's|%{{APPDATA_RELEASE}}%|<release version="${{ env.BUILD_VERSION }}" date="${{ steps.date.outputs.date }}" />|' linux/com.github.KRTirtho.Spotube.appdata.xml
|
|
||||||
|
|
||||||
- name: Build Binaries (stable)
|
|
||||||
if: ${{ inputs.channel == 'stable' }}
|
|
||||||
run: |
|
|
||||||
docker buildx build --platform=linux/arm64 -f .github/Dockerfile . --build-arg FLUTTER_VERSION=${{env.FLUTTER_VERSION}} --build-arg BUILD_VERSION=${{env.BUILD_VERSION}} -t krtirtho/spotube_linux_arm:latest --load
|
|
||||||
|
|
||||||
- name: Build Binaries (nightly)
|
|
||||||
if: ${{ inputs.channel == 'nightly' }}
|
|
||||||
run: |
|
|
||||||
docker buildx build --platform=linux/arm64 -f .github/Dockerfile . --build-arg FLUTTER_VERSION=${{env.FLUTTER_VERSION}} --build-arg BUILD_VERSION=nightly -t krtirtho/spotube_linux_arm:latest --load
|
|
||||||
|
|
||||||
- name: Copy the built packages
|
|
||||||
run: |
|
|
||||||
docker images ls
|
|
||||||
docker create --name spotube_linux_arm krtirtho/spotube_linux_arm:latest
|
|
||||||
docker cp spotube_linux_arm:/app/dist/ dist/
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: ${{ inputs.channel == 'stable' }}
|
|
||||||
with:
|
|
||||||
if-no-files-found: error
|
|
||||||
name: Spotube-Release-Binaries
|
|
||||||
path: |
|
|
||||||
dist/Spotube-linux-aarch64.deb
|
|
||||||
dist/spotube-linux-${{ env.BUILD_VERSION }}-aarch64.tar.xz
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: ${{ inputs.channel == 'nightly' }}
|
|
||||||
with:
|
|
||||||
if-no-files-found: error
|
|
||||||
name: Spotube-Release-Binaries
|
|
||||||
path: |
|
|
||||||
dist/Spotube-linux-aarch64.deb
|
|
||||||
dist/spotube-linux-nightly-aarch64.tar.xz
|
|
||||||
|
|
||||||
- name: Debug With SSH When fails
|
|
||||||
if: ${{ failure() && inputs.debug && inputs.channel == 'nightly' }}
|
|
||||||
uses: mxschmitt/action-tmate@v3
|
|
||||||
with:
|
|
||||||
limit-access-to-actor: true
|
|
||||||
|
|
||||||
android:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: subosito/flutter-action@v2.12.0
|
- uses: subosito/flutter-action@v2.12.0
|
||||||
@ -298,6 +60,7 @@ jobs:
|
|||||||
cache: true
|
cache: true
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||||
- name: Setup Java
|
- name: Setup Java
|
||||||
|
if: ${{matrix.platform == 'android'}}
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: 'zulu'
|
distribution: 'zulu'
|
||||||
@ -305,65 +68,26 @@ jobs:
|
|||||||
cache: 'gradle'
|
cache: 'gradle'
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install ${{matrix.platform}} dependencies
|
||||||
run: |
|
run: dart cli/cli.dart install-dependencies --platform=${{matrix.platform}}
|
||||||
sudo apt-get update -y
|
|
||||||
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev make python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse xmlstarlet
|
|
||||||
|
|
||||||
- name: Replace pubspec version and BUILD_VERSION Env (nightly)
|
|
||||||
if: ${{ inputs.channel == 'nightly' }}
|
|
||||||
run: |
|
|
||||||
curl -sS https://webi.sh/yq | sh
|
|
||||||
yq -i '.version |= sub("\+\d+", "+${{ inputs.channel }}.")' pubspec.yaml
|
|
||||||
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
|
|
||||||
echo "BUILD_VERSION=${{ inputs.version }}+${{ inputs.channel }}.${{ github.run_number }}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: BUILD_VERSION Env (stable)
|
|
||||||
if: ${{ inputs.channel == 'stable' }}
|
|
||||||
run: |
|
|
||||||
echo "BUILD_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Create Stable .env
|
|
||||||
if: ${{ inputs.channel == 'stable' }}
|
|
||||||
run: echo '${{ secrets.DOTENV_RELEASE }}' > .env
|
|
||||||
|
|
||||||
- name: Create Nightly .env
|
|
||||||
if: ${{ inputs.channel == 'nightly' }}
|
|
||||||
run: echo '${{ secrets.DOTENV_NIGHTLY }}' > .env
|
|
||||||
|
|
||||||
- name: Generate Secrets
|
|
||||||
run: |
|
|
||||||
flutter pub get
|
|
||||||
dart run build_runner build --delete-conflicting-outputs
|
|
||||||
|
|
||||||
- name: Sign Apk
|
- name: Sign Apk
|
||||||
|
if: ${{matrix.platform == 'android'}}
|
||||||
run: |
|
run: |
|
||||||
echo '${{ secrets.KEYSTORE }}' | base64 --decode > android/app/upload-keystore.jks
|
echo '${{ secrets.KEYSTORE }}' | base64 --decode > android/app/upload-keystore.jks
|
||||||
echo '${{ secrets.KEY_PROPERTIES }}' > android/key.properties
|
echo '${{ secrets.KEY_PROPERTIES }}' > android/key.properties
|
||||||
|
|
||||||
- name: Build Apk
|
- name: Build ${{matrix.platform}} binaries
|
||||||
run: |
|
run: dart cli/cli.dart build ${{matrix.platform}}
|
||||||
flutter build apk --flavor ${{ inputs.channel }}
|
env:
|
||||||
mv build/app/outputs/flutter-apk/app-${{ inputs.channel }}-release.apk build/Spotube-android-all-arch.apk
|
CHANNEL: ${{inputs.channel}}
|
||||||
|
DOTENV: ${{secrets.DOTENV_RELEASE}}
|
||||||
- name: Build Playstore AppBundle
|
|
||||||
run: |
|
|
||||||
echo 'ENABLE_UPDATE_CHECK=0' >> .env
|
|
||||||
dart run build_runner build --delete-conflicting-outputs
|
|
||||||
export MANIFEST=android/app/src/main/AndroidManifest.xml
|
|
||||||
xmlstarlet ed -d '//meta-data[@android:name="com.google.android.gms.car.application"]' $MANIFEST > $MANIFEST.tmp
|
|
||||||
mv $MANIFEST.tmp $MANIFEST
|
|
||||||
flutter build appbundle --flavor ${{ inputs.channel }}
|
|
||||||
mv build/app/outputs/bundle/${{ inputs.channel }}Release/app-${{ inputs.channel }}-release.aab build/Spotube-playstore-all-arch.aab
|
|
||||||
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
name: Spotube-Release-Binaries
|
name: Spotube-Release-Binaries
|
||||||
path: |
|
path: ${{matrix.files}}
|
||||||
build/Spotube-android-all-arch.apk
|
|
||||||
build/Spotube-playstore-all-arch.aab
|
|
||||||
|
|
||||||
- name: Debug With SSH When fails
|
- name: Debug With SSH When fails
|
||||||
if: ${{ failure() && inputs.debug && inputs.channel == 'nightly' }}
|
if: ${{ failure() && inputs.debug && inputs.channel == 'nightly' }}
|
||||||
@ -371,135 +95,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
limit-access-to-actor: true
|
limit-access-to-actor: true
|
||||||
|
|
||||||
macos:
|
|
||||||
runs-on: macos-14
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: subosito/flutter-action@v2.12.0
|
|
||||||
with:
|
|
||||||
cache: true
|
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
|
||||||
|
|
||||||
- name: Replace pubspec version and BUILD_VERSION Env (nightly)
|
|
||||||
if: ${{ inputs.channel == 'nightly' }}
|
|
||||||
run: |
|
|
||||||
brew install yq
|
|
||||||
yq -i '.version |= sub("\+\d+", "+${{ inputs.channel }}.")' pubspec.yaml
|
|
||||||
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
|
|
||||||
echo "BUILD_VERSION=${{ inputs.version }}+${{ inputs.channel }}.${{ github.run_number }}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: BUILD_VERSION Env (stable)
|
|
||||||
if: ${{ inputs.channel == 'stable' }}
|
|
||||||
run: |
|
|
||||||
echo "BUILD_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Create Stable .env
|
|
||||||
if: ${{ inputs.channel == 'stable' }}
|
|
||||||
run: echo '${{ secrets.DOTENV_RELEASE }}' > .env
|
|
||||||
|
|
||||||
- name: Create Nightly .env
|
|
||||||
if: ${{ inputs.channel == 'nightly' }}
|
|
||||||
run: echo '${{ secrets.DOTENV_NIGHTLY }}' > .env
|
|
||||||
|
|
||||||
- name: Generate Secrets
|
|
||||||
run: |
|
|
||||||
dart pub global activate flutter_distributor
|
|
||||||
flutter pub get
|
|
||||||
dart run build_runner build --delete-conflicting-outputs
|
|
||||||
|
|
||||||
- name: Build Macos App
|
|
||||||
run: |
|
|
||||||
flutter config --enable-macos-desktop
|
|
||||||
flutter build macos
|
|
||||||
du -sh build/macos/Build/Products/Release/spotube.app
|
|
||||||
|
|
||||||
- name: Package Macos App
|
|
||||||
run: |
|
|
||||||
brew install python-setuptools
|
|
||||||
npm install -g appdmg
|
|
||||||
mkdir -p build/${{ env.BUILD_VERSION }}
|
|
||||||
appdmg appdmg.json build/Spotube-macos-universal.dmg
|
|
||||||
flutter_distributor package --platform=macos --targets pkg --skip-clean
|
|
||||||
mv dist/**/spotube-*-macos.pkg build/Spotube-macos-universal.pkg
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
if-no-files-found: error
|
|
||||||
name: Spotube-Release-Binaries
|
|
||||||
path: |
|
|
||||||
build/Spotube-macos-universal.dmg
|
|
||||||
build/Spotube-macos-universal.pkg
|
|
||||||
|
|
||||||
- name: Debug With SSH When fails
|
|
||||||
if: ${{ failure() && inputs.debug && inputs.channel == 'nightly' }}
|
|
||||||
uses: mxschmitt/action-tmate@v3
|
|
||||||
with:
|
|
||||||
limit-access-to-actor: true
|
|
||||||
|
|
||||||
iOS:
|
|
||||||
runs-on: macos-14
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: subosito/flutter-action@v2.10.0
|
|
||||||
with:
|
|
||||||
cache: true
|
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
|
||||||
|
|
||||||
- name: Replace pubspec version and BUILD_VERSION Env (nightly)
|
|
||||||
if: ${{ inputs.channel == 'nightly' }}
|
|
||||||
run: |
|
|
||||||
brew install yq
|
|
||||||
yq -i '.version |= sub("\+\d+", "+${{ inputs.channel }}.")' pubspec.yaml
|
|
||||||
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
|
|
||||||
echo "BUILD_VERSION=${{ inputs.version }}+${{ inputs.channel }}.${{ github.run_number }}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: BUILD_VERSION Env (stable)
|
|
||||||
if: ${{ inputs.channel == 'stable' }}
|
|
||||||
run: |
|
|
||||||
echo "BUILD_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Create Stable .env
|
|
||||||
if: ${{ inputs.channel == 'stable' }}
|
|
||||||
run: echo '${{ secrets.DOTENV_RELEASE }}' > .env
|
|
||||||
|
|
||||||
- name: Create Nightly .env
|
|
||||||
if: ${{ inputs.channel == 'nightly' }}
|
|
||||||
run: echo '${{ secrets.DOTENV_NIGHTLY }}' > .env
|
|
||||||
|
|
||||||
- name: Generate Secrets
|
|
||||||
run: |
|
|
||||||
flutter pub get
|
|
||||||
dart run build_runner build --delete-conflicting-outputs
|
|
||||||
|
|
||||||
- name: Build iOS iPA
|
|
||||||
run: |
|
|
||||||
flutter build ios --release --no-codesign --flavor ${{ inputs.channel }}
|
|
||||||
ln -sf ./build/ios/iphoneos Payload
|
|
||||||
zip -r9 Spotube-iOS.ipa Payload/${{ inputs.channel }}.app
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
if-no-files-found: error
|
|
||||||
name: Spotube-Release-Binaries
|
|
||||||
path: |
|
|
||||||
Spotube-iOS.ipa
|
|
||||||
|
|
||||||
- name: Debug With SSH When fails
|
|
||||||
if: ${{ failure() && inputs.debug && inputs.channel == 'nightly' }}
|
|
||||||
uses: mxschmitt/action-tmate@v3
|
|
||||||
with:
|
|
||||||
limit-access-to-actor: true
|
|
||||||
|
|
||||||
upload:
|
upload:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
needs:
|
needs:
|
||||||
- windows
|
- build_platform
|
||||||
- linux
|
|
||||||
- linux_arm
|
|
||||||
- android
|
|
||||||
- macos
|
|
||||||
- iOS
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
@ -515,6 +114,10 @@ jobs:
|
|||||||
md5sum Spotube-Release-Binaries/* >> RELEASE.md5sum
|
md5sum Spotube-Release-Binaries/* >> RELEASE.md5sum
|
||||||
sha256sum Spotube-Release-Binaries/* >> RELEASE.sha256sum
|
sha256sum Spotube-Release-Binaries/* >> RELEASE.sha256sum
|
||||||
sed -i 's|Spotube-Release-Binaries/||' RELEASE.sha256sum RELEASE.md5sum
|
sed -i 's|Spotube-Release-Binaries/||' RELEASE.sha256sum RELEASE.md5sum
|
||||||
|
|
||||||
|
- name: Extract pubspec version
|
||||||
|
run: |
|
||||||
|
echo "PUBSPEC_VERSION=$(grep -oP 'version:\s*\K[^+]+(?=\+)' pubspec.yaml)" >> $GITHUB_ENV
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
@ -529,7 +132,7 @@ jobs:
|
|||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
tag: v${{ inputs.version }} # mind the "v" prefix
|
tag: v${{ env.PUBSPEC_VERSION }} # mind the "v" prefix
|
||||||
omitBodyDuringUpdate: true
|
omitBodyDuringUpdate: true
|
||||||
omitNameDuringUpdate: true
|
omitNameDuringUpdate: true
|
||||||
omitPrereleaseDuringUpdate: true
|
omitPrereleaseDuringUpdate: true
|
||||||
@ -547,3 +150,4 @@ jobs:
|
|||||||
omitPrereleaseDuringUpdate: true
|
omitPrereleaseDuringUpdate: true
|
||||||
allowUpdates: true
|
allowUpdates: true
|
||||||
artifacts: Spotube-Release-Binaries/*,RELEASE.sha256sum,RELEASE.md5sum
|
artifacts: Spotube-Release-Binaries/*,RELEASE.sha256sum,RELEASE.md5sum
|
||||||
|
body: 'Build Number: ${{github.run_number}}'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user