Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 80 additions & 49 deletions .github/workflows/build_release.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,41 @@
name: Build Release
name: Build & Release

on:
push:
branches:
- main
branches:
- 'main'
paths:
- "lib/**"
- "video_player/lib/**"
- 'lib/**'
- 'video_player/lib/**'

jobs:
create-release:
runs-on: ubuntu-latest
outputs:
tag: v${{ steps.yaml-version.outputs['version'] }}
steps:
- uses: actions/checkout@v4

- name: Parse pubspec.yaml
id: yaml-version
uses: nichmor/[email protected]
with:
config: pubspec.yaml

- name: Create release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
tag_name: v${{ steps.yaml-version.outputs['version'] }}

build_android:
name: Build and sign android bundle
needs: create-release
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4

- name: Setup the Java environment
Expand All @@ -24,6 +48,7 @@ jobs:
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true

- name: Create signing key
uses: timheuer/[email protected]
Expand All @@ -43,94 +68,100 @@ jobs:
run: |
flutter pub get
flutter build appbundle
ls -lah
- name: Rename bundle
run: mv build/app/outputs/bundle/release/app-release.aab build/app/outputs/bundle/release/AlbumShare-{{github.ref_name}}-android.aab
run: mv build/app/outputs/bundle/release/app-release.aab build/app/outputs/bundle/release/album_share-${{ needs.create-release.outputs.tag }}-android.aab

- name: Create symbols archive
uses: thedoctor0/[email protected]
with:
type: "zip"
filename: AlbumShare-{{github.ref_name}}-android-symbols.zip
directory: build/app/intermediates/merged_natove_libs/release/out/lib/
filename: album_share-${{ needs.create-release.outputs.tag }}-android-symbols.zip
directory: build/app/intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib

- name: Add files to release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
build/app/intermediates/merged_natove_libs/release/out/lib/AlbumShare-{{github.ref_name}}-android-symbols.zip
build/app/outputs/bundle/release/AlbumShare-{{github.ref_name}}-android.aab
draft: true
tag_name: ${{ needs.create-release.outputs.tag }}
files: |
**/album_share-${{ needs.create-release.outputs.tag }}-android-symbols.zip
**/album_share-${{ needs.create-release.outputs.tag }}-android.aab
build_linux:
runs-on: ubuntu-latest
needs: create-release
steps:
- uses: actions/checkout@v4

- name: Install flutter dependencies
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-0 libgtk-3-dev libblkid1 liblzma5 libmpv-dev mpv
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libmpv-dev mpv
- name: Setup the flutter environment
uses: subosito/flutter-action@v2
with:
channel: "stable"

- name: Install project dependencies
run: flutter pub get

- name: Generate build files
run: dart run build_runner build --delete-conflicting-outputs
cache: true

- name: Build
run: flutter build linux --release
run: |
flutter pub get
flutter build linux --release
- name: Creative archive
- name: Create archive
uses: thedoctor0/[email protected]
with:
type: "zip"
filename: AlbumShare-{{github.ref_name}}-linux.zip
filename: album_share-${{ needs.create-release.outputs.tag }}-linux.zip
directory: build/linux/x64/release/bundle

- name: Add archive to release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: build/linux/x64/release/bundle/AlbumShare-{{github.ref_name}}-linux.zip
draft: true
tag_name: ${{ needs.create-release.outputs.tag }}
files: |
**/album_share-${{ needs.create-release.outputs.tag }}-linux.zip
build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
# build_windows:
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v4

- name: Setup the flutter environment
uses: subosito/flutter-action@v2
with:
channel: "stable"
# - name: Setup the flutter environment
# uses: subosito/flutter-action@v2
# with:
# channel: "stable"

- name: Install project dependencies
run: flutter pub get
# - name: Install project dependencies
# run: flutter pub get

- name: Generate build files
run: dart run build_runner build --delete-conflicting-outputs
# - name: Generate build files
# run: dart run build_runner build --delete-conflicting-outputs

- name: Build
run: flutter build windows --release
# - name: Build
# run: flutter build windows --release

- name: Creative archive
uses: thedoctor0/[email protected]
with:
type: "zip"
filename: AlbumShare-{{github.ref_name}}-windows.zip
directory: build/windows/x64/runner/Release
# - name: Creative archive
# uses: thedoctor0/[email protected]
# with:
# type: "zip"
# filename: AlbumShare-{{github.ref_name}}-windows.zip
# directory: build/windows/x64/runner/Release

- name: Add archive to release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: build/windows/x64/runner/Release/AlbumShare-{{github.ref_name}}-windows.zip
# - name: Add archive to release
# uses: softprops/action-gh-release@v2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# files: build/windows/x64/runner/Release/AlbumShare-{{github.ref_name}}-windows.zip

# build_macos:
# runs-on: macos-latest
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/create-version-tag.yaml

This file was deleted.

59 changes: 41 additions & 18 deletions .github/workflows/version-checks.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
name: Verify version & release notes have been updated
name: Version checks

on:
push:
paths:
- "/nonexistant"
pull_request:
types:
- opened
- edited
- synchronize

jobs:
verify-version:

check-files-changed:
name: Check files have changed that would require a version bump.
runs-on: ubuntu-latest
outputs:
should-verify: ${{ contains(steps.changed-files.outputs.changed_files, 'lib/') }}
steps:
- id: changed-files
uses: knu/changed-files@v1
with:
paths: |
'**/lib'

- name: show changed files
run: |
echo "Changed files:"
echo "${{ steps.changed-files.outputs.changed_files }}"
echo "Matched files:"
echo "${{ steps.changed-files.outputs.matched_files }}"
echo "Should verify:"
echo "${{ contains(steps.changed-files.outputs.changed_files, 'lib/') }} "

verify-version:
name: Verify pubspec version has been bumped & release notes updated.
runs-on: ubuntu-latest
needs: check-files-changed
if: ${{ needs.check-files-changed.outputs.should-verify == 'true'}}

steps:
- uses: actions/checkout@v4
with:
Expand All @@ -22,13 +49,9 @@ jobs:
CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}

- name: List files
id: list-files
run: ls -lah

- name: Parse pubspec.yaml
id: yaml-version
uses: pietrobolcato/action-read-yaml@1.0.0
uses: nichmor/minimal-read-yaml@v0.0.2
with:
config: pubspec.yaml

Expand All @@ -39,18 +62,18 @@ jobs:
- name: Fetch previous tag
id: tag-version
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: 0.0.1

- name: Display tag version
run: |
echo "${{ steps.tag-version.outputs.tag }}"

- name: "Setup Dart environment"
uses: dart-lang/setup-dart@v1

- name: Install Dart dependencies

- uses: dart-lang/setup-dart@v1
- name: Verify version increase
id: version-up
run: |
cd version_check
dart pub get

- name: Compare versions
run: dart run version_check/bin/version_check.dart -p "${{ steps.tag-version.outputs.tag }}" -n "${{ steps.yaml-version.outputs.data }}"
dart run bin/version_check.dart -p "${{ steps.tag-version.outputs.tag }}" -n "${{ steps.yaml-version.outputs['version'] }}"