-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add automatic integration & publish workflows
- Loading branch information
1 parent
d1ce889
commit 5e0a131
Showing
3 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Integration | ||
|
||
on: | ||
pull_request: | ||
workflow_call: | ||
|
||
jobs: | ||
lint: | ||
name: Check for linting or typing errors | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Dart SDK | ||
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f | ||
- name: Install dependencies | ||
run: dart pub get | ||
- name: Run code analysis | ||
run: dart analyze | ||
|
||
test: | ||
name: Run unit tests suite | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Dart SDK | ||
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f | ||
- name: Install dependencies | ||
run: dart pub get | ||
- name: Run code analysis | ||
run: dart test -r expanded |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Publish to pub.dev | ||
|
||
# Publish workflow releases a new version, updates changelog | ||
# and publishes the library to pub.dev | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
integration: | ||
name: Run integration | ||
uses: ./.github/workflows/integration.yml | ||
|
||
release-version: | ||
name: Release a new version | ||
needs: integration | ||
uses: dronetag/gha-shared/.github/workflows/create-release.yml@master | ||
concurrency: release-version-${{ github.repository }} | ||
with: | ||
install-changelog-plugin: true | ||
must-release: true | ||
secrets: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
bump-pubspec: | ||
name: Bump version in pubspec.yaml | ||
needs: release-version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- uses: dronetag/gha-shared/.github/actions/update-pubspec-version@master | ||
with: | ||
version: ${{ needs.release-version.outputs.version }} | ||
- name: Commit & push | ||
run: | | ||
git commit -a -m "chore: Bump pubspec.yaml version to ${{ needs.release-version.outputs.version }}" | ||
git push | ||
publish: | ||
name: Publish to pub.dev | ||
needs: bump-pubspec | ||
permissions: | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Dart SDK | ||
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f | ||
- name: Install dependencies | ||
run: dart pub get | ||
- name: Publish to pub.dev | ||
run: dart pub publish -f |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"branches": [ | ||
"master", | ||
{ | ||
"name": "alpha", | ||
"prerelease": true | ||
}, | ||
{ | ||
"name": "beta", | ||
"prerelease": true | ||
} | ||
], | ||
"plugins": [ | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
"releaseRules": [ | ||
{ | ||
"type": "docs", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "refactor", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "style", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "chore", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "perf", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "test", | ||
"release": "patch" | ||
} | ||
] | ||
} | ||
], | ||
"@semantic-release/release-notes-generator", | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
"changelogFile": "CHANGELOG.md" | ||
} | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": [ | ||
"CHANGELOG.md" | ||
] | ||
} | ||
] | ||
] | ||
} |