cd: categorized task with name and upload artifacts to release instead

This commit is contained in:
Kingkor Roy Tirtho 2023-02-05 09:38:59 +06:00
parent ac84942917
commit f533151adb

View File

@ -13,38 +13,55 @@ jobs:
- uses: subosito/flutter-action@v2.8.0 - uses: subosito/flutter-action@v2.8.0
with: with:
cache: true cache: true
flutter-version: '3.3.8' flutter-version: "3.3.8"
- name: Get current date
- name: Getting current date
id: date id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- run: |
- name: Installing dependencies and configuring version
run: |
sudo apt-get update -y 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 patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev sudo apt-get install -y tar 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 libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
- run: | 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 appimage-builder
run: |
wget -O appimage-builder https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage wget -O appimage-builder https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage
chmod +x appimage-builder chmod +x appimage-builder
mv appimage-builder /usr/local/bin/ mv appimage-builder /usr/local/bin/
- run: | - name: Generating Secrets
curl -sS https://webi.sh/yq | sh run: |
yq -i '.version |= sub("\+\d+", "-nightly-")' pubspec.yaml
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
echo '${{ secrets.DOTENV_NIGHTLY }}' > .env echo '${{ secrets.DOTENV_NIGHTLY }}' > .env
flutter config --enable-linux-desktop
flutter pub get
dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}' dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}'
- name: Building Linux application
run: |
dart pub global activate flutter_distributor dart pub global activate flutter_distributor
flutter_distributor package --platform=linux --targets=deb,appimage --skip-clean flutter_distributor package --platform=linux --targets=deb,appimage --skip-clean
make tar make tar
- run: | mv build/Spotube-linux-x86_64.tar.xz dist/Spotube-linux-x86_64-nightly-${{ github.run_number }}.tar.xz
mv build/Spotube-linux-x86_64.tar.xz dist/ mv dist/**/spotube-*-linux.deb dist/Spotube-linux-x86_64-nightly-${{ github.run_number }}.deb
mv dist/**/spotube-*-linux.deb dist/Spotube-linux-x86_64.deb mv dist/**/spotube-*-linux.AppImage dist/Spotube-linux-x86_64-nightly-${{ github.run_number }}.AppImage
mv dist/**/spotube-*-linux.AppImage dist/Spotube-linux-x86_64.AppImage
- uses: actions/upload-artifact@v3 - name: Uploading binaries to release
uses: svenstaro/upload-release-action@v2
with: with:
name: Spotube-Linux-Bundle repo_token: ${{ secrets.GITHUB_TOKEN }}
path: dist/ file_glob: true
- name: Setup upterm session 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() }} if: ${{ failure() }}
uses: lhotari/action-upterm@v1 uses: lhotari/action-upterm@v1
with: with:
@ -57,28 +74,41 @@ jobs:
- uses: subosito/flutter-action@v2.8.0 - uses: subosito/flutter-action@v2.8.0
with: with:
cache: true cache: true
flutter-version: '3.3.8' flutter-version: "3.3.8"
- run: |
- name: Installing dependencies and configuring version
run: |
sudo apt-get update -y 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 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
- run: |
curl -sS https://webi.sh/yq | sh curl -sS https://webi.sh/yq | sh
yq -i '.version |= sub("\+\d+", "-nightly-")' pubspec.yaml yq -i '.version |= sub("\+\d+", "-nightly-")' pubspec.yaml
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
echo '${{ secrets.DOTENV_NIGHTLY }}' > .env
flutter pub get 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 }}' dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}'
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: Building Android apk
run: |
flutter build apk flutter build apk
make apk mv build/app/outputs/apk/release/app-release.apk build/Spotube-android-all-arch-nightly-${{ github.run_number }}.apk
- uses: actions/upload-artifact@v2
- name: Uploading binaries to release
uses: svenstaro/upload-release-action@v2
with: with:
name: Spotube-Android-Bundle repo_token: ${{ secrets.GITHUB_TOKEN }}
path: | file: build/Spotube-android-all-arch-nightly-${{ github.run_number }}.apk
build/Spotube-android-all-arch.apk tag: refs/tags/nightly
- name: Setup upterm session body: |
## nightly-${{ github.run_number }}
Nightly build no. ${{ github.run_number }} of Spotube
overwrite: true
- name: Setting up upterm session
if: ${{ failure() }} if: ${{ failure() }}
uses: lhotari/action-upterm@v1 uses: lhotari/action-upterm@v1
with: with:
@ -88,33 +118,43 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
# Build Windows Executable
- uses: subosito/flutter-action@v2.8.0 - uses: subosito/flutter-action@v2.8.0
with: with:
cache: true cache: true
flutter-version: '3.3.8' flutter-version: "3.3.8"
- run: |
- name: Installing dependencies and configuring versions
run: |
choco install sed make yq -y choco install sed make yq -y
yq -i '.version |= sub("\+\d+", "-nightly-")' pubspec.yaml yq -i '.version |= sub("\+\d+", "-nightly-")' pubspec.yaml
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
sed -i "s/%{{SPOTUBE_VERSION}}%/${{ env.GITHUB_RUN_NUMBER }}/" windows/runner/Runner.rc sed -i "s/%{{SPOTUBE_VERSION}}%/${{ github.run_number }}/" windows/runner/Runner.rc
echo '${{ secrets.DOTENV_NIGHTLY }}' > .env
flutter config --enable-windows-desktop flutter config --enable-windows-desktop
flutter pub get flutter pub get
- name: Generating Secrets
run: |
echo '${{ secrets.DOTENV_NIGHTLY }}' > .env
dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}' dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}'
- name: Building for Windows x64
run: |
dart pub global activate flutter_distributor dart pub global activate flutter_distributor
make innoinstall make innoinstall
flutter_distributor package --platform=windows --targets=exe --skip-clean flutter_distributor package --platform=windows --targets=exe --skip-clean
mv dist/**/spotube-*-windows-setup.exe dist/Spotube-windows-x86_64-setup-nightly-${{ github.run_number }}.exe
# Create Chocolatey Package - name: Uploading binaries to release
# setting the sha256 hash for new bundle uses: svenstaro/upload-release-action@v2
- run: mv dist/**/spotube-*-windows-setup.exe dist/Spotube-windows-x86_64-setup.exe
# Upload artifacts
- uses: actions/upload-artifact@v3
with: with:
name: Spotube-Windows-Bundle repo_token: ${{ secrets.GITHUB_TOKEN }}
path: dist/ 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: build_macos:
runs-on: macos-11 runs-on: macos-11
@ -123,24 +163,39 @@ jobs:
- uses: subosito/flutter-action@v2.8.0 - uses: subosito/flutter-action@v2.8.0
with: with:
cache: true cache: true
flutter-version: '3.3.8' flutter-version: "3.3.8"
- run: brew install yq
- run: yq -i '.version |= sub("\+\d+", "-nightly-")' pubspec.yaml - name: Installing dependencies and configuring versions
- run: yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml run: |
- run: echo '${{ secrets.DOTENV_NIGHTLY }}' > .env brew install yq
- run: flutter config --enable-macos-desktop yq -i '.version |= sub("\+\d+", "-nightly-")' pubspec.yaml
- run: flutter pub get yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
- run: dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}' flutter config --enable-macos-desktop
- run: flutter build macos flutter pub get
- run: du -sh build/macos/Build/Products/Release/spotube.app
- run: npm install -g appdmg - name: Generating Secrets
- run: appdmg appdmg.json build/Spotube-macos-x86_64.dmg run: |
- uses: actions/upload-artifact@v2 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-${{ github.run_number }}.dmg
- name: Uploading binaries to release
uses: svenstaro/upload-release-action@v2
with: with:
name: Spotube-Macos-Bundle repo_token: ${{ secrets.GITHUB_TOKEN }}
path: | file: build/Spotube-macos-x86_64-nightly-${{ github.run_number }}.dmg
build/Spotube-macos-x86_64.dmg tag: refs/tags/nightly
- name: Setup upterm session body: |
## nightly-${{ github.run_number }}
Nightly build no. ${{ github.run_number }} of Spotube
overwrite: true
- name: Setting up upterm session
if: ${{ failure() }} if: ${{ failure() }}
uses: lhotari/action-upterm@v1 uses: lhotari/action-upterm@v1
with: with: