Skip to content

Commit

Permalink
ci: Publish from GitHub CI (#1760)
Browse files Browse the repository at this point in the history
# Description

This allows publishing audioplayers from the GitHub CI.
The PR creation is available as a workflow dispatch (with option for
prerelease) to not overwhelm the PR pipeline.

See: dart-lang/pub-dev#7177
  • Loading branch information
Gustl22 authored Aug 18, 2024
1 parent 9d25e78 commit af6da24
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 26 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
with:
flutter-version: ${{ inputs.flutter_version }}
channel: ${{ inputs.flutter_channel }}
- uses: bluefireteam/melos-action@main
- uses: bluefireteam/melos-action@v3

- name: Example app - Build Web app
working-directory: ./packages/audioplayers/example
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
with:
flutter-version: ${{ inputs.flutter_version }}
channel: ${{ inputs.flutter_channel }}
- uses: bluefireteam/melos-action@main
- uses: bluefireteam/melos-action@v3

- name: Example App - Build Android APK
working-directory: ./packages/audioplayers/example
Expand All @@ -169,7 +169,7 @@ jobs:
with:
flutter-version: ${{ inputs.flutter_version }}
channel: ${{ inputs.flutter_channel }}
- uses: bluefireteam/melos-action@main
- uses: bluefireteam/melos-action@v3

- name: Example app - Build iOS
working-directory: ./packages/audioplayers/example
Expand All @@ -185,7 +185,7 @@ jobs:
with:
flutter-version: ${{ inputs.flutter_version }}
channel: ${{ inputs.flutter_channel }}
- uses: bluefireteam/melos-action@main
- uses: bluefireteam/melos-action@v3

- name: Example app - Build macOS
working-directory: ./packages/audioplayers/example
Expand All @@ -201,7 +201,7 @@ jobs:
with:
flutter-version: ${{ inputs.flutter_version }}
channel: ${{ inputs.flutter_channel }}
- uses: bluefireteam/melos-action@main
- uses: bluefireteam/melos-action@v3

- name: Example app - Build Windows app
working-directory: ./packages/audioplayers/example
Expand All @@ -217,7 +217,7 @@ jobs:
with:
flutter-version: ${{ inputs.flutter_version }}
channel: ${{ inputs.flutter_channel }}
- uses: bluefireteam/melos-action@main
- uses: bluefireteam/melos-action@v3

- name: Install Flutter requirements for Linux
run: |
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/release-prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Prepare release
on:
workflow_dispatch:
inputs:
prerelease:
description: 'Version as prerelease'
required: false
default: false
type: boolean

jobs:
call-min-flutter-test:
uses: ./.github/workflows/test.yml
with:
flutter_version: '3.22.0'
fatal_warnings: false
prepare-release:
name: Prepare release
needs: call-min-flutter-test
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- uses: bluefireteam/melos-action@v3
with:
run-versioning: ${{ inputs.prerelease == false }}
run-versioning-prerelease: ${{ inputs.prerelease == true }}
publish-dry-run: true
create-pr: true
git-email: contact@blue-fire.xyz
git-name: Bluefireteam
20 changes: 20 additions & 0 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish packages
on:
workflow_dispatch:

jobs:
publish-packages:
name: Publish packages
permissions:
contents: write
id-token: write # Required for authentication using OIDC
runs-on: [ ubuntu-latest ]
if: contains(github.event.head_commit.message, 'chore(release)')
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- uses: bluefireteam/melos-action@v3
with:
publish: true
git-email: contact@blue-fire.xyz
git-name: Bluefireteam
18 changes: 18 additions & 0 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Tag release
on:
push:
branches: [main]

jobs:
publish-packages:
name: Create tag for a release
permissions:
contents: write
runs-on: [ ubuntu-latest ]
if: contains(github.event.head_commit.message, 'chore(release)')
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- uses: bluefireteam/melos-action@v3
with:
tag: true
12 changes: 0 additions & 12 deletions .github/workflows/release.yml

This file was deleted.

14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
with:
flutter-version: ${{ inputs.flutter_version }}
channel: ${{ inputs.flutter_channel }}
- uses: bluefireteam/melos-action@main
- uses: bluefireteam/melos-action@v3

- run: melos format --set-exit-if-changed
- run: melos analyze ${{ inputs.fatal_warnings && '--fatal-infos' || '--no-fatal-warnings' }}
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
with:
flutter-version: ${{ inputs.flutter_version }}
channel: ${{ inputs.flutter_channel }}
- uses: bluefireteam/melos-action@main
- uses: bluefireteam/melos-action@v3
- uses: nanasess/setup-chromedriver@v2

- name: Run Flutter integration tests
Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
with:
flutter-version: ${{ inputs.flutter_version }}
channel: ${{ inputs.flutter_channel }}
- uses: bluefireteam/melos-action@main
- uses: bluefireteam/melos-action@v3

- name: Download Android emulator image
run: |
Expand Down Expand Up @@ -240,7 +240,7 @@ jobs:
with:
flutter-version: ${{ inputs.flutter_version }}
channel: ${{ inputs.flutter_channel }}
- uses: bluefireteam/melos-action@main
- uses: bluefireteam/melos-action@v3

- name: Run Flutter integration tests
working-directory: ./packages/audioplayers/example
Expand Down Expand Up @@ -312,7 +312,7 @@ jobs:
with:
flutter-version: ${{ inputs.flutter_version }}
channel: ${{ inputs.flutter_channel }}
- uses: bluefireteam/melos-action@main
- uses: bluefireteam/melos-action@v3

- name: Run Flutter integration tests
working-directory: ./packages/audioplayers/example
Expand All @@ -333,7 +333,7 @@ jobs:
with:
flutter-version: ${{ inputs.flutter_version }}
channel: ${{ inputs.flutter_channel }}
- uses: bluefireteam/melos-action@main
- uses: bluefireteam/melos-action@v3
- name: Start audio server
run: net start audiosrv
- name: Download virtual audio device
Expand Down Expand Up @@ -378,7 +378,7 @@ jobs:
with:
flutter-version: ${{ inputs.flutter_version }}
channel: ${{ inputs.flutter_channel }}
- uses: bluefireteam/melos-action@main
- uses: bluefireteam/melos-action@v3
- name: Install Flutter requirements for Linux
run: |
sudo apt-get update
Expand Down
1 change: 0 additions & 1 deletion packages/audioplayers/example/server/public/files/audio

This file was deleted.

0 comments on commit af6da24

Please sign in to comment.