forked from KRTirtho/spotube
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cd: Armbuild Circleci project setup (KRTirtho#723)
* chore: fill missing translations * chore: vscode filenesting * docs: Add meenbeese (KRTirtho#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 <[email protected]>
- Loading branch information
Showing
10 changed files
with
528 additions
and
276 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
gh: circleci/[email protected] | ||
|
||
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 |
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,5 +26,4 @@ generic_name: Music Streaming Application | |
categories: | ||
- Music | ||
|
||
|
||
startup_notify: true |
Oops, something went wrong.