chore: add pub release job
This commit is contained in:
parent
4bbb1fbba7
commit
427be0e0b8
|
|
@ -36,6 +36,8 @@ jobs:
|
||||||
scripts/prepare.sh
|
scripts/prepare.sh
|
||||||
scripts/test_driver.sh"
|
scripts/test_driver.sh"
|
||||||
|
|
||||||
|
# coverage is done on the flutter image because we setup olm there
|
||||||
|
# coverage_without_olm is done on dart images because why not :D
|
||||||
coverage:
|
coverage:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
|
|
@ -44,7 +46,7 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
sed -i 's/#\([^ ]\)/\1/g' pubspec.yaml
|
sed -i 's/#flutter_test/flutter_test/g' pubspec.yaml
|
||||||
rm -r example
|
rm -r example
|
||||||
./scripts/prepare.sh
|
./scripts/prepare.sh
|
||||||
./scripts/test.sh
|
./scripts/test.sh
|
||||||
|
|
@ -70,7 +72,27 @@ jobs:
|
||||||
image: dart:${{inputs.dart_version}}
|
image: dart:${{inputs.dart_version}}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Run tests
|
- name: pub.dev publish dry run
|
||||||
run: |
|
run: |
|
||||||
dart pub get
|
dart pub get
|
||||||
dart pub publish --dry-run
|
dart pub publish --dry-run
|
||||||
|
|
||||||
|
pub-dev:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
container:
|
||||||
|
image: dart:${{inputs.dart_version}}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: pub.dev publish
|
||||||
|
run: |
|
||||||
|
if [ -z ${{ secrets.PUB_DEV_CREDENTIALS }}" ]; then
|
||||||
|
echo "Missing PUB_DEV_CREDENTIALS environment variable"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p ~/.config/dart/
|
||||||
|
cp "${{ secrets.PUB_DEV_CREDENTIALS }}" ~/.config/dart/pub-credentials.json
|
||||||
|
|
||||||
|
dart pub get
|
||||||
|
dart pub publish --force
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
tags:
|
||||||
|
- v[0-9]+.[0-9]+.[0-9]+
|
||||||
pull_request:
|
pull_request:
|
||||||
merge_group:
|
merge_group:
|
||||||
|
|
||||||
|
|
@ -11,14 +13,31 @@ concurrency:
|
||||||
group: ${{ github.ref }}
|
group: ${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
FLUTTER_VERSION: 3.10.6
|
||||||
|
DART_VERSION: 3.0.6
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# because there is no easy way to pass env variables to jobs
|
||||||
|
versions:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
flutter_version: ${{ steps.flutterver.outputs.FLUTTER_VERSION }}
|
||||||
|
dart_version: ${{ steps.dartver.outputs.DART_VERSION }}
|
||||||
|
steps:
|
||||||
|
- id: flutterver
|
||||||
|
run: echo "FLUTTER_VERSION=${{ env.FLUTTER_VERSION }}" >> "$GITHUB_OUTPUT"
|
||||||
|
- id: dartver
|
||||||
|
run: echo "DART_VERSION=${{ env.DART_VERSION }}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
dart:
|
dart:
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
uses: famedly/frontend-ci-templates/.github/workflows/dart.yml@main
|
uses: famedly/frontend-ci-templates/.github/workflows/dart.yml@main
|
||||||
|
needs: [versions]
|
||||||
with:
|
with:
|
||||||
flutter_version: 3.10.4
|
flutter_version: ${{ needs.versions.outputs.flutter_version }}
|
||||||
dart_version: 3.0.0
|
dart_version: ${{ needs.versions.outputs.dart_version }}
|
||||||
secrets:
|
secrets:
|
||||||
ssh_key: "${{ secrets.CI_SSH_PRIVATE_KEY }}"
|
ssh_key: "${{ secrets.CI_SSH_PRIVATE_KEY }}"
|
||||||
|
|
||||||
|
|
@ -30,6 +49,7 @@ jobs:
|
||||||
app_jobs:
|
app_jobs:
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
uses: ./.github/workflows/app.yml
|
uses: ./.github/workflows/app.yml
|
||||||
|
needs: [versions]
|
||||||
with:
|
with:
|
||||||
flutter_version: 3.10.4
|
flutter_version: ${{ needs.versions.outputs.flutter_version }}
|
||||||
dart_version: 3.0.3
|
dart_version: ${{ needs.versions.outputs.dart_version }}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue