Skip to content

Commit

Permalink
Fix publish action (close #38)
Browse files Browse the repository at this point in the history
  • Loading branch information
matus-tomlein committed Feb 21, 2024
1 parent c0f0ef1 commit 5f08a64
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 33 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
matrix:
flutter: ['3.19.0']
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter }}
channel: 'stable'
Expand All @@ -20,8 +20,8 @@ jobs:
name: Analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.19.0'
channel: 'stable'
Expand All @@ -33,7 +33,7 @@ jobs:
name: Integration tests on Android
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions/setup-java@v1
with:
java-version: "11.x"
Expand All @@ -58,7 +58,7 @@ jobs:
run: while ! nc -z '0.0.0.0' 9090; do sleep 1; done

# -- Integration tests --
- uses: subosito/flutter-action@v1
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.19.0'
channel: 'stable'
Expand All @@ -77,7 +77,7 @@ jobs:
name: Integration tests on iOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# -- Micro --
- name: Cache Micro
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
erase_before_boot: true
shutdown_after_job: true

- uses: subosito/flutter-action@v1
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.19.0'
channel: 'stable'
Expand All @@ -122,7 +122,7 @@ jobs:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2
- uses: actions/checkout@v4

# -- Micro --
- name: Cache Micro
Expand All @@ -144,7 +144,7 @@ jobs:
run: while ! nc -z '0.0.0.0' 9090; do sleep 1; done

# -- Integration tests --
- uses: subosito/flutter-action@v1
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.19.0'
channel: 'stable'
Expand Down
49 changes: 26 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish package to pub.dev and make a GitHub release
on:
push:
tags:
- '*.*.*'
- '[0-9]+.[0-9]+.[0-9]+*'

jobs:
test:
Expand All @@ -13,8 +13,8 @@ jobs:
matrix:
flutter: ['3.19.0']
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter }}
channel: 'stable'
Expand All @@ -28,7 +28,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v2
Expand Down Expand Up @@ -61,34 +61,37 @@ jobs:
fi
publish_pubdev:
needs: ["test", "version_check"]
runs-on: ubuntu-latest
container:
image: google/dart:latest
needs: ["test", "version_check"]
permissions:
id-token: write
steps:
- uses: actions/checkout@v1
- name: Setup credentials
run: |
mkdir -p ~/.pub-cache
cat <<EOF > ~/.pub-cache/credentials.json
{
"accessToken":"${{ secrets.ACCESS_TOKEN }}",
"refreshToken":"${{ secrets.REFRESH_TOKEN }}",
"tokenEndpoint":"https://accounts.google.com/o/oauth2/token",
"scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ],
"expiration": 1643122520446
}
EOF
- name: Publish package
run: pub publish -f
- uses: actions/checkout@v4

- name: Setup Dart
uses: dart-lang/setup-dart@v1
with:
sdk: stable

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true

- name: Check Flutter version
run: flutter --version

- name: Publish to pub.dev
run: flutter pub publish --force

release:
needs: ["test", "publish_pubdev", "version_check"]
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Release
uses: softprops/action-gh-release@v0.1.7
Expand Down

0 comments on commit 5f08a64

Please sign in to comment.