bump version and changelog #21
This file contains hidden or 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: | |
| - main | |
| name: CI | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - 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@v2 | |
| - 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@v2 | |
| - 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/main' | |
| 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/main' | |
| 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 | |
| echo y | dart pub publish |