Skip to content

Commit

Permalink
Change github workflow, update dependencies, update pubspec
Browse files Browse the repository at this point in the history
update dart sdk dependency

add auto publish on pub.dev

update  Readme
  • Loading branch information
LukaGiorgadze committed Feb 14, 2023
1 parent ba8c544 commit 2c57fda
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 58 deletions.
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## Your checklist for this pull request

Please review the [guidelines for contributing](https://github.com/lomsa-dev/http-mock-adapter/blob/develop/CONTRIBUTING.md) to this repository.
Please review the [guidelines for contributing](https://github.com/lomsa-dev/http-mock-adapter/blob/main/CONTRIBUTING.md) to this repository.

- [ ] Make sure you are requesting to **pull a `feature`/`bugfix` branch** (right side). Don't request your `main` or `develop`!
- [ ] Make sure you are making a pull request against the **`develop` branch** (left side). Also, you should start *your branch* off *our `develop`*.
- [ ] Make sure you are requesting to **pull a `feature`/`bugfix` branch** (right side). Don't request your `main`!
- [ ] Make sure you are making a pull request against the **`main` branch** (left side). Also, you should start *your branch* off *our `main`*.
- [ ] Make sure that you add reviewers, assignees, labels, projects, milestones and linkes issues to the pull request as you see fit.
- [ ] Check the commit's or even all commits' message styles to match our requested structure.
- [ ] Check your code additions will fail neither code linting checks nor unit test.
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/dart-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Dart CI
# This workflow is triggered on pull requests and pushes to the repository.
on:
pull_request:
branches: [develop, main]
branches: [main]
push:
branches: [develop, main]
branches: [main]

jobs:
ci:
Expand All @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout the repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup Dart SDK
uses: dart-lang/setup-dart@v1
Expand All @@ -36,11 +36,15 @@ jobs:
- name: Analyze project source
run: dart analyze

- name: Test the package
run: dart pub global activate coverage && dart test --coverage=coverage && format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.packages --report-on=lib
- name: Install coverage tools
run: dart pub global activate coverage

- name: Test with coverage
run: dart pub global run coverage:test_with_coverage

- name: Code Coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage/lcov.info
fail_ci_if_error: true
44 changes: 17 additions & 27 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
name: Publish Package
name: Publish to pub.dev

on:
push:
branches: main
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*' # tag pattern on pub.dev: 'v'

# Publish using custom workflow
jobs:
build:
publish:
permissions:
id-token: write # This is required for authentication using OIDC
runs-on: ubuntu-latest
container:
image: google/dart:latest
steps:
- uses: actions/checkout@v1
- name: curl
uses: wei/curl@v1
- name: Install dependencies
run: pub get
- name: Run tests
run: pub run test
- name: Setup credentials
run: |
mkdir -p ~/.pub-cache
cat <<EOF > ~/.pub-cache/credentials.json
{
"accessToken":"${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }}",
"refreshToken":"${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }}",
"tokenEndpoint":"https://accounts.google.com/o/oauth2/token",
"scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ],
"expiration": ${{ secrets.PUB_DEV_PUBLISH_EXPIRATION }}
}
EOF
- name: Publish package
run: pub publish -f

- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
- name: Install dependencies
run: dart pub get
- name: Run tests
run: dart pub run test
# Here you can insert custom steps you need
# - run: dart tool/generate-code.dart
- name: Publish
run: dart pub publish --force
26 changes: 12 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ Subsequently, the date entry follows **YYYY-MM-DD** format in accordance with th
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

---
## [v0.4.0] (2023-02-14)

- **Updated**
- Dio dependency to `5.0.0`
- Github Workflow (release on tag)
- Codecov token
- Collection to 1.17.1

- **Removed**
- Recursive export of matchers.dart
- Unnecessary ListParam

## [v0.3.3] (2022-03-23)

Expand Down Expand Up @@ -190,17 +201,4 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- **Added**
- The MIT License.

[v0.3.2]: https://github.com/lomsa-dev/http-mock-adapter/compare/e1da999215a72378356b1b4883d32807091bf239...ac4991fb2c9808be44bd8165941bf7d9101de5bf
[v0.3.1]: https://github.com/lomsa-dev/http-mock-adapter/compare/e1da999215a72378356b1b4883d32807091bf239...70fb7802f0ad48e03abb16a7197b933b1306c332
[v0.3.0]: https://github.com/lomsa-dev/http-mock-adapter/compare/70fb7802f0ad48e03abb16a7197b933b1306c332...f138e738dea358a386537adfb9df3e1c5dc79c0c
[v0.2.1]: https://github.com/lomsa-dev/http-mock-adapter/compare/f138e738dea358a386537adfb9df3e1c5dc79c0c...ec13a0f1ca3cb0fd56620832a79db5ab04ad8742
[v0.2.0]: https://github.com/lomsa-dev/http-mock-adapter/compare/24cafff5236f8cc7d52a05529751ac47abd895ff...f138e738dea358a386537adfb9df3e1c5dc79c0c
[v0.1.6]: https://github.com/lomsa-dev/http-mock-adapter/compare/ff0b5b1c9d976e774002f3176fa0b6acd193c715...24cafff5236f8cc7d52a05529751ac47abd895ff
[v0.1.5]: https://github.com/lomsa-dev/http-mock-adapter/compare/19310519550fc6402eb760ee5f3ef0757d187b89...ff0b5b1c9d976e774002f3176fa0b6acd193c715
[v0.1.4]: https://github.com/lomsa-dev/http-mock-adapter/compare/21f5d211b8a798206fe4a727bff3a60eb8e3dcaf...19310519550fc6402eb760ee5f3ef0757d187b89
[v0.1.3]: https://github.com/lomsa-dev/http-mock-adapter/compare/c0ab40ed59d3898ebf03d706b25ca8b91c2d065d...21f5d211b8a798206fe4a727bff3a60eb8e3dcaf
[v0.1.2]: https://github.com/lomsa-dev/http-mock-adapter/compare/87c41f1758660b94efc1538de39fb04bb12c0b95...c0ab40ed59d3898ebf03d706b25ca8b91c2d065d
[v0.1.1]: https://github.com/lomsa-dev/http-mock-adapter/compare/c3da8b18fb583cac0500f9899c4901f40fdf18e5...87c41f1758660b94efc1538de39fb04bb12c0b95
[v0.1.0]: https://github.com/lomsa-dev/http-mock-adapter/compare/7d3ffbf4f85ae69327b1736f9268df24607d7ccb...c3da8b18fb583cac0500f9899c4901f40fdf18e5
[v0.0.1]: https://github.com/lomsa-dev/http-mock-adapter/compare/447829b2969300e0ff7e9d6a7c6697cd5744b632...7d3ffbf4f85ae69327b1736f9268df24607d7ccb

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ A pull request doesn't necessarily have to include finished work. It may be bett
Here's how to contribute and submit your pull request:

1. [**Fork the repository**](https://help.github.com/articles/fork-a-repo/) and clone it locally. Add the original repository as a remote and pull in changes every so often so that you stay up to date with the project.
2. [**Create a branch**](https://guides.github.com/introduction/flow/) from `develop` for your changes.
2. [**Create a branch**](https://guides.github.com/introduction/flow/) from `main` for your changes.
3. **Add, commit, and push** your changes to your branch.
4. **Test out your changes.** Make sure that they work as you intended.
5. [**Open a pull request**](https://github.com/lomsa-dev/http-mock-adapter/pulls) to merge your branch into `develop`.
5. [**Open a pull request**](https://github.com/lomsa-dev/http-mock-adapter/pulls) to merge your branch into `main`.
- Reference any issues related to your PR (e.g. "Resolves #123").
- Describe your changes in detail and include screenshots if necessary.
6. :sunglasses: Sit back, relax, and wait for your PR to be reviewed. You might have to tweak your contribution or elaborate on your changes. That's OK, don't be afraid to justify your reasoning and ask questions.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![Package Version](https://img.shields.io/pub/v/http_mock_adapter?color=teal)](https://pub.dev/packages/http_mock_adapter "Published package version")
[![Style: Lints](https://img.shields.io/badge/style-lints-teal.svg)](https://github.com/dart-lang/lints "Package linter helper")
[![Dart CI](https://github.com/lomsa-dev/http-mock-adapter/workflows/Dart%20CI/badge.svg?branch=develop)](https://github.com/lomsa-dev/http-mock-adapter/actions?query=workflow%3A%22Dart+CI%22 "Dart CI workflow")
[![Publish Package](https://github.com/lomsa-dev/http-mock-adapter/workflows/Publish%20Package/badge.svg?branch=main)](https://github.com/lomsa-dev/http-mock-adapter/actions?query=workflow%3A%22Publish+Package%22 "Publish Package workflow")
[![Dart CI](https://github.com/lomsa-dev/http-mock-adapter/workflows/Dart%20CI/badge.svg?branch=main)](https://github.com/lomsa-dev/http-mock-adapter/actions?query=workflow%3A%22Dart+CI%22 "Dart CI workflow")
[![Publish Package](https://github.com/lomsa-dev/http-mock-adapter/workflows/Publish%20to%20pub.dev/badge.svg)](https://github.com/lomsa-dev/http-mock-adapter/actions/workflows/publish.yml "Publish Package workflow")
[![LICENSE](https://img.shields.io/badge/License-MIT-red.svg)](https://github.com/lomsa-dev/http-mock-adapter#License "Project's LICENSE section")
[![codecov](https://codecov.io/gh/lomsa-dev/http-mock-adapter/branch/main/graph/badge.svg?token=7H1HPCGFJ6)](https://codecov.io/gh/lomsa-dev/http-mock-adapter)

Expand Down Expand Up @@ -73,7 +73,7 @@ Add this to your package's `pubspec.yaml` file:

```yaml
dev_dependencies:
http_mock_adapter: ^0.3.3
http_mock_adapter: ^0.4.0
```

#### Install it
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: http_mock_adapter
description: A simple to use mocking package for Dio intended to be used in tests. It provides various types and methods to declaratively mock request-response communication.
version: 0.3.3
version: 0.4.0
homepage: https://lomsa.com
repository: https://github.com/lomsa-dev/http-mock-adapter
issue_tracker: https://github.com/lomsa-dev/http-mock-adapter/issues

environment:
sdk: ">=2.15.0 <3.0.0"
sdk: ">=2.18.0 <3.0.0"

dependencies:
collection: ^1.15.0
collection: ^1.17.1
dio: ^5.0.0
http_parser: ^4.0.2

Expand Down

0 comments on commit 2c57fda

Please sign in to comment.