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 4f754a0 commit da99d24
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
flutter: ['3.19.0']
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter }}
channel: 'stable'
Expand All @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.19.0'
channel: 'stable'
Expand Down Expand Up @@ -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 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 Down Expand Up @@ -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
39 changes: 19 additions & 20 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 @@ -14,7 +14,7 @@ jobs:
flutter: ['3.19.0']
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter }}
channel: 'stable'
Expand Down Expand Up @@ -61,26 +61,25 @@ 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
strategy:
matrix:
flutter: ['3.19.0']
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@v2
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter }}
channel: 'stable'
- name: Install dependencies
run: flutter pub get
- name: Publish - dry run
run: flutter pub publish --dry-run
- name: Publish to pub.dev
run: flutter pub publish -f

release:
needs: ["test", "publish_pubdev", "version_check"]
Expand Down

0 comments on commit da99d24

Please sign in to comment.