This repository has been archived by the owner on Oct 2, 2024. It is now read-only.
Merge pull request #419 from comigor/end-of-life #113
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- master | |
- beta | |
name: CI | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dart-lang/setup-dart@v1.3 | |
with: | |
sdk: stable | |
- id: install | |
name: Install dependencies | |
run: dart pub get | |
- name: Check formatting | |
if: always() && steps.install.outcome == 'success' | |
run: dart format --set-exit-if-changed . | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dart-lang/setup-dart@v1.3 | |
with: | |
sdk: stable | |
- id: install | |
name: Install dependencies | |
run: dart pub get | |
- name: Test | |
if: always() && steps.install.outcome == 'success' | |
run: dart test | |
analyze: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dart-lang/setup-dart@v1.3 | |
with: | |
sdk: stable | |
- id: install | |
name: Install dependencies | |
run: dart pub get | |
- name: Analyze | |
if: always() && steps.install.outcome == 'success' | |
run: dart analyze | |
create-tag-and-release: | |
needs: | |
- lint | |
- test | |
- analyze | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta' | |
steps: | |
- uses: actions/checkout@master | |
- id: check_version_and_changelog | |
name: Check if version on pubspec.yaml was changed and if there's an entry for this new version on CHANGELOG | |
uses: comigor/actions/check-version-and-changelog@master | |
with: | |
base_ref: "${{ github.ref }}" | |
- name: Push tag | |
uses: anothrNick/github-tag-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CUSTOM_TAG: "v${{ steps.check_version_and_changelog.outputs.package_version }}" | |
- name: Create release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: "v${{ steps.check_version_and_changelog.outputs.package_version }}" | |
release_name: "Release v${{ steps.check_version_and_changelog.outputs.package_version }}" | |
deploy: | |
needs: create-tag-and-release | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta' | |
steps: | |
- uses: actions/checkout@master | |
- uses: dart-lang/setup-dart@v1.3 | |
with: | |
sdk: stable | |
- id: install | |
name: Install dependencies | |
run: dart pub get | |
- name: Publish to pub.dev | |
run: | | |
mkdir -p ~/.config/dart | |
echo '${{ secrets.PUB_CREDENTIALS }}' > ~/.config/dart/pub-credentials.json | |
dart pub publish --force |