mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
cd: Armbuild Circleci project setup (#723)
* chore: fill missing translations * chore: vscode filenesting * docs: Add meenbeese (#713) * CircleCI Commit * cd: updated circle ci build config * cd: use custom flutter installation * cd: use ubuntu 22.04 * cd: fix project var syntax * cd: directly echo secrets to .env file * cd: export bash env * cd: they I'm stupid * cd: ugghh breaking flutter changes on every major version * cd: add other empty keys to .env * cd: works!!! * cd: store artifacts * cd: add other package formats in circle ci build * cd: add pub cache path * cd: remove dart run from flutter_distributor * cd: add appimage installer * cd: sudo * cd: appimagetool in path * cd: use aarch64 binary of appimagetool * cd: add rpmbuild deps * cd: fix rpm arch * cd: add github release upload capability * cd: enable github creds context * cd: remove token * cd: remove parallelism * cd: why typo??! * cd: add github action to trigger Circle CI pipeline * cd: trigger CCI using curl * cd: remove quotes from bool field * cd: ain't no * cd: poor choice --------- Co-authored-by: meenbeese <meenbeese@tutanota.com>
This commit is contained in:
parent
de335f4834
commit
7aff0d3f1e
179
.circleci/config.yml
Normal file
179
.circleci/config.yml
Normal file
@ -0,0 +1,179 @@
|
|||||||
|
version: 2.1
|
||||||
|
|
||||||
|
orbs:
|
||||||
|
gh: circleci/github-cli@2.2.0
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
flutter_linux_arm:
|
||||||
|
machine:
|
||||||
|
image: ubuntu-2204:current
|
||||||
|
resource_class: arm.medium
|
||||||
|
parameters:
|
||||||
|
version:
|
||||||
|
type: string
|
||||||
|
default: 3.1.1
|
||||||
|
channel:
|
||||||
|
type: enum
|
||||||
|
enum:
|
||||||
|
- release
|
||||||
|
- nightly
|
||||||
|
default: release
|
||||||
|
github_run_number:
|
||||||
|
type: string
|
||||||
|
default: "0"
|
||||||
|
dry_run:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- gh/setup
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Get current date
|
||||||
|
command: |
|
||||||
|
echo "export CURRENT_DATE=$(date +%Y-%m-%d)" >> $BASH_ENV
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Install dependencies
|
||||||
|
command: |
|
||||||
|
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 zip rpm
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Install Flutter
|
||||||
|
command: |
|
||||||
|
git clone https://github.com/flutter/flutter.git
|
||||||
|
cd flutter && git checkout stable && cd ..
|
||||||
|
export PATH="$PATH:`pwd`/flutter/bin"
|
||||||
|
flutter precache
|
||||||
|
flutter doctor -v
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Install AppImageTool
|
||||||
|
command: |
|
||||||
|
wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-aarch64.AppImage"
|
||||||
|
chmod +x appimagetool
|
||||||
|
mv appimagetool flutter/bin
|
||||||
|
|
||||||
|
- persist_to_workspace:
|
||||||
|
root: flutter
|
||||||
|
paths:
|
||||||
|
- .
|
||||||
|
|
||||||
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [<< parameters.channel >>, nightly]
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Replace pubspec version and BUILD_VERSION Env (nightly)
|
||||||
|
command: |
|
||||||
|
curl -sS https://webi.sh/yq | sh
|
||||||
|
yq -i '.version |= sub("\+\d+", "+<< parameters.channel >>.")' pubspec.yaml
|
||||||
|
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
|
||||||
|
echo 'export BUILD_VERSION="<< parameters.version >>+<< parameters.channel >>.<< parameters.github_run_number >>"' >> $BASH_ENV
|
||||||
|
|
||||||
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [<< parameters.channel >>, release]
|
||||||
|
steps:
|
||||||
|
- run: echo 'export BUILD_VERSION="<< parameters.version >>"' >> $BASH_ENV
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Generate .env file
|
||||||
|
command: |
|
||||||
|
echo "SPOTIFY_SECRETS=${SPOTIFY_SECRETS}" >> .env
|
||||||
|
echo "SUPABASE_URL=${SUPABASE_URL}" >> .env
|
||||||
|
echo "SUPABASE_API_KEY=${SUPABASE_API_KEY}" >> .env
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Replace Version in files
|
||||||
|
command: |
|
||||||
|
sed -i 's|%{{APPDATA_RELEASE}}%|<release version="${BUILD_VERSION}" date="${CURRENT_DATE}" />|' linux/com.github.KRTirtho.Spotube.appdata.xml
|
||||||
|
echo "build_arch: aarch64" >> linux/packaging/rpm/make_config.yaml
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Build secrets
|
||||||
|
command: |
|
||||||
|
export PATH="$PATH:`pwd`/flutter/bin"
|
||||||
|
flutter config --enable-linux-desktop
|
||||||
|
flutter pub get
|
||||||
|
dart run build_runner build --delete-conflicting-outputs --enable-experiment=records,patterns
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Build Flutter app
|
||||||
|
command: |
|
||||||
|
export PATH="$PATH:`pwd`/flutter/bin"
|
||||||
|
export PATH="$PATH":"$HOME/.pub-cache/bin"
|
||||||
|
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=appimage
|
||||||
|
flutter_distributor package --platform=linux --targets=rpm
|
||||||
|
|
||||||
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [<< parameters.channel >>, nightly]
|
||||||
|
steps:
|
||||||
|
- run: make tar VERSION=nightly ARCH=arm64 PKG_ARCH=aarch64
|
||||||
|
|
||||||
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [<< parameters.channel >>, release]
|
||||||
|
steps:
|
||||||
|
- run: make tar VERSION=${BUILD_VERSION} ARCH=arm64 PKG_ARCH=aarch64
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Move artifacts
|
||||||
|
command: |
|
||||||
|
mkdir bundle
|
||||||
|
mv build/spotube-linux-*-aarch64.tar.xz bundle/
|
||||||
|
mv dist/**/spotube-*-linux.deb bundle/Spotube-linux-aarch64.deb
|
||||||
|
mv dist/**/spotube-*-linux.rpm bundle/Spotube-linux-aarch64.rpm
|
||||||
|
mv dist/**/spotube-*-linux.AppImage bundle/Spotube-linux-aarch64.AppImage
|
||||||
|
zip -r Spotube-linux-aarch64.zip bundle
|
||||||
|
|
||||||
|
- store_artifacts:
|
||||||
|
path: Spotube-linux-aarch64.zip
|
||||||
|
|
||||||
|
- when:
|
||||||
|
condition:
|
||||||
|
and:
|
||||||
|
- equal: [<< parameters.dry_run >>, false]
|
||||||
|
- equal: [<< parameters.channel >>, release]
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Upload to release (release)
|
||||||
|
command: gh release upload v<< parameters.version >> bundle/* --clobber
|
||||||
|
|
||||||
|
- when:
|
||||||
|
condition:
|
||||||
|
and:
|
||||||
|
- equal: [<< parameters.dry_run >>, false]
|
||||||
|
- equal: [<< parameters.channel >>, nightly]
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Upload to release (nightly)
|
||||||
|
command: gh release upload nightly bundle/* --clobber
|
||||||
|
|
||||||
|
parameters:
|
||||||
|
GHA_Actor:
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
GHA_Action:
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
GHA_Event:
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
GHA_Meta:
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
|
||||||
|
workflows:
|
||||||
|
build_flutter_for_arm_workflow:
|
||||||
|
when: << pipeline.parameters.GHA_Action >>
|
||||||
|
jobs:
|
||||||
|
- flutter_linux_arm:
|
||||||
|
context:
|
||||||
|
- org-global
|
||||||
|
- GITHUB_CREDS
|
24
.github/workflows/spotube-release-binary.yml
vendored
24
.github/workflows/spotube-release-binary.yml
vendored
@ -26,7 +26,7 @@ on:
|
|||||||
default: true
|
default: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
FLUTTER_VERSION: '3.10.0'
|
FLUTTER_VERSION: '3.13.2'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
windows:
|
windows:
|
||||||
@ -164,11 +164,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Create tar.xz (stable)
|
- name: Create tar.xz (stable)
|
||||||
if: ${{ inputs.channel == 'stable' }}
|
if: ${{ inputs.channel == 'stable' }}
|
||||||
run: make tar VERSION=${{ env.BUILD_VERSION }}
|
run: make tar VERSION=${{ env.BUILD_VERSION }} ARCH=x64 PKG_ARCH=x86_64
|
||||||
|
|
||||||
- name: Create tar.xz (nightly)
|
- name: Create tar.xz (nightly)
|
||||||
if: ${{ inputs.channel == 'nightly' }}
|
if: ${{ inputs.channel == 'nightly' }}
|
||||||
run: make tar VERSION=nightly
|
run: make tar VERSION=nightly ARCH=x64 PKG_ARCH=x86_64
|
||||||
|
|
||||||
- name: Move Files to dist
|
- name: Move Files to dist
|
||||||
run: |
|
run: |
|
||||||
@ -323,6 +323,24 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
build/Spotube-macos-universal.dmg
|
build/Spotube-macos-universal.dmg
|
||||||
|
|
||||||
|
# linux_arm:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# steps:
|
||||||
|
# - run: |
|
||||||
|
# sudo apt-get update -y
|
||||||
|
# sudo apt-get install -y curl
|
||||||
|
|
||||||
|
# - name: Extract branch name
|
||||||
|
# shell: bash
|
||||||
|
# run: echo "BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# - name: Trigger CircleCI Pipeline
|
||||||
|
# run: |
|
||||||
|
# curl -X POST https://circleci.com/api/v2/project/cci-f9azl/spotube/pipeline \
|
||||||
|
# --header "Circle-Token: ${{secrets.CCI_TOKEN}}" \
|
||||||
|
# --header "content-type: application/json" \
|
||||||
|
# --data '{"branch": "${{env.BRANCH}}", "parameters":{"GHA_Action":"true","version":"${{inputs.version}}","channel":"${{inputs.channel}}","dry_run":${{inputs.dry_run}}}}'
|
||||||
|
|
||||||
upload:
|
upload:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
|
17
Makefile
17
Makefile
@ -1,17 +1,8 @@
|
|||||||
INNO_VERSION=6.2.0
|
INNO_VERSION=6.2.0
|
||||||
TEMP_DIR=/tmp/spotube-tar
|
TEMP_DIR=/tmp/spotube-tar
|
||||||
USR_SHARE=deb-struct/usr/share
|
USR_SHARE=deb-struct/usr/share
|
||||||
BUNDLE_DIR=build/linux/x64/release/bundle
|
BUNDLE_DIR=build/linux/${ARCH}/release/bundle
|
||||||
MIRRORLIST=${PWD}/build/mirrorlist
|
MIRRORLIST=${PWD}/build/mirrorlist
|
||||||
deb:
|
|
||||||
mkdir -p ${USR_SHARE}/spotube\
|
|
||||||
&& mkdir -p $(USR_SHARE)/applications $(USR_SHARE)/icons/spotube $(USR_SHARE)/spotube $(USR_SHARE)/appdata\
|
|
||||||
&& cp -r $(BUNDLE_DIR)/* $(USR_SHARE)/spotube\
|
|
||||||
&& cp linux/spotube.desktop $(USR_SHARE)/applications/\
|
|
||||||
&& cp linux/com.github.KRTirtho.Spotube.appdata.xml $(USR_SHARE)/appdata/spotube.appdata.xml\
|
|
||||||
&& cp assets/spotube-logo.png $(USR_SHARE)/icons/spotube\
|
|
||||||
&& sed -i 's|com.github.KRTirtho.Spotube|spotube|' $(USR_SHARE)/appdata/spotube.appdata.xml\
|
|
||||||
&& dpkg-deb -b deb-struct/ build/Spotube-linux-x86_64.deb
|
|
||||||
|
|
||||||
tar:
|
tar:
|
||||||
mkdir -p $(TEMP_DIR)\
|
mkdir -p $(TEMP_DIR)\
|
||||||
@ -19,13 +10,9 @@ tar:
|
|||||||
&& cp linux/spotube.desktop $(TEMP_DIR)\
|
&& cp linux/spotube.desktop $(TEMP_DIR)\
|
||||||
&& cp assets/spotube-logo.png $(TEMP_DIR)\
|
&& cp assets/spotube-logo.png $(TEMP_DIR)\
|
||||||
&& cp linux/com.github.KRTirtho.Spotube.appdata.xml $(TEMP_DIR)\
|
&& cp linux/com.github.KRTirtho.Spotube.appdata.xml $(TEMP_DIR)\
|
||||||
&& tar -cJf build/spotube-linux-${VERSION}-x86_64.tar.xz -C $(TEMP_DIR) .\
|
&& tar -cJf build/spotube-linux-${VERSION}-${PKG_ARCH}.tar.xz -C $(TEMP_DIR) .\
|
||||||
&& rm -rf $(TEMP_DIR)
|
&& rm -rf $(TEMP_DIR)
|
||||||
|
|
||||||
appimage:
|
|
||||||
appimage-builder --recipe AppImageBuilder.yml\
|
|
||||||
&& mv Spotube-*-x86_64.AppImage build
|
|
||||||
|
|
||||||
aursrcinfo:
|
aursrcinfo:
|
||||||
docker run -e EXPORT_SRC=1 -v ${PWD}/aur-struct:/pkg -v ${MIRRORLIST}:/etc/pacman.d/mirrorlist:ro whynothugo/makepkg
|
docker run -e EXPORT_SRC=1 -v ${PWD}/aur-struct:/pkg -v ${MIRRORLIST}:/etc/pacman.d/mirrorlist:ro whynothugo/makepkg
|
||||||
|
|
||||||
|
@ -170,8 +170,9 @@ You can compile Spotube's source code by [following these instructions](CONTRIBU
|
|||||||
## 👥 The Spotube team
|
## 👥 The Spotube team
|
||||||
|
|
||||||
- [Kingkor Roy Tirtho](https://github.com/KRTirtho) - The Founder, Maintainer and Lead Developer
|
- [Kingkor Roy Tirtho](https://github.com/KRTirtho) - The Founder, Maintainer and Lead Developer
|
||||||
- [Owen Connor](https://github.com/owencz1998) - The Cool Discord Moderator
|
|
||||||
- [RaptaG](https://github.com/RaptaG) - The GitHub Moderator and Community Manager
|
- [RaptaG](https://github.com/RaptaG) - The GitHub Moderator and Community Manager
|
||||||
|
- [Owen Connor](https://github.com/owencz1998) - The Cool Discord Moderator
|
||||||
|
- [Meenbeese](https://github.com/meenbeese) - The Android Developer
|
||||||
- [Piotr Rogowski](https://github.com/karniv00l) - The MacOS Developer
|
- [Piotr Rogowski](https://github.com/karniv00l) - The MacOS Developer
|
||||||
- [Rusty Apple](https://github.com/RustyApple) - The Mysterious Unknown Guy
|
- [Rusty Apple](https://github.com/RustyApple) - The Mysterious Unknown Guy
|
||||||
|
|
||||||
|
@ -130,7 +130,16 @@ class AssetGenImage {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageProvider provider() => AssetImage(_assetName);
|
ImageProvider provider({
|
||||||
|
AssetBundle? bundle,
|
||||||
|
String? package,
|
||||||
|
}) {
|
||||||
|
return AssetImage(
|
||||||
|
_assetName,
|
||||||
|
bundle: bundle,
|
||||||
|
package: package,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
String get path => _assetName;
|
String get path => _assetName;
|
||||||
|
|
||||||
|
@ -5,13 +5,15 @@ part 'env.g.dart';
|
|||||||
@Envied(obfuscate: true, requireEnvFile: true, path: ".env")
|
@Envied(obfuscate: true, requireEnvFile: true, path: ".env")
|
||||||
abstract class Env {
|
abstract class Env {
|
||||||
@EnviedField(varName: 'SUPABASE_URL')
|
@EnviedField(varName: 'SUPABASE_URL')
|
||||||
static final supabaseUrl = _Env.supabaseUrl;
|
static final String? supabaseUrl = _Env.supabaseUrl;
|
||||||
|
|
||||||
@EnviedField(varName: 'SUPABASE_API_KEY')
|
@EnviedField(varName: 'SUPABASE_API_KEY')
|
||||||
static final supabaseAnonKey = _Env.supabaseAnonKey;
|
static final String? supabaseAnonKey = _Env.supabaseAnonKey;
|
||||||
|
|
||||||
@EnviedField(varName: 'SPOTIFY_SECRETS')
|
@EnviedField(varName: 'SPOTIFY_SECRETS')
|
||||||
static final spotifySecrets = _Env.spotifySecrets.split(',').map((e) {
|
static final String rawSpotifySecrets = _Env.rawSpotifySecrets;
|
||||||
|
|
||||||
|
static final spotifySecrets = rawSpotifySecrets.split(',').map((e) {
|
||||||
final secrets = e.trim().split(":").map((e) => e.trim());
|
final secrets = e.trim().split(":").map((e) => e.trim());
|
||||||
return {
|
return {
|
||||||
"clientId": secrets.first,
|
"clientId": secrets.first,
|
||||||
@ -20,7 +22,7 @@ abstract class Env {
|
|||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
@EnviedField(varName: 'ENABLE_UPDATE_CHECK', defaultValue: "1")
|
@EnviedField(varName: 'ENABLE_UPDATE_CHECK', defaultValue: "1")
|
||||||
static final _enableUpdateChecker = _Env._enableUpdateChecker;
|
static final String _enableUpdateChecker = _Env._enableUpdateChecker;
|
||||||
|
|
||||||
static bool get enableUpdateChecker => _enableUpdateChecker == "1";
|
static bool get enableUpdateChecker => _enableUpdateChecker == "1";
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,8 @@ import 'package:supabase/supabase.dart';
|
|||||||
|
|
||||||
class SupabaseService {
|
class SupabaseService {
|
||||||
static final api = SupabaseClient(
|
static final api = SupabaseClient(
|
||||||
Env.supabaseUrl,
|
Env.supabaseUrl ?? "",
|
||||||
Env.supabaseAnonKey,
|
Env.supabaseAnonKey ?? "",
|
||||||
);
|
);
|
||||||
|
|
||||||
Future<void> insertTrack(MatchedTrack track) async {
|
Future<void> insertTrack(MatchedTrack track) async {
|
||||||
|
@ -26,5 +26,4 @@ generic_name: Music Streaming Application
|
|||||||
categories:
|
categories:
|
||||||
- Music
|
- Music
|
||||||
|
|
||||||
|
|
||||||
startup_notify: true
|
startup_notify: true
|
||||||
|
528
pubspec.lock
528
pubspec.lock
File diff suppressed because it is too large
Load Diff
@ -121,6 +121,7 @@ dev_dependencies:
|
|||||||
|
|
||||||
dependency_overrides:
|
dependency_overrides:
|
||||||
http: ^1.1.0
|
http: ^1.1.0
|
||||||
|
system_tray: 2.0.2
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
generate: true
|
generate: true
|
||||||
|
Loading…
Reference in New Issue
Block a user