-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: updated workflow to automate github and pub.dev release (#47)
* feat: updated workflow to automate github and pub.dev release Signed-off-by: Mohit Kumar Singh <[email protected]> * feat: added configuration file for semantic-release Signed-off-by: Mohit Kumar Singh <[email protected]> * feat: updated config file Signed-off-by: Mohit Kumar Singh <[email protected]>
- Loading branch information
Showing
2 changed files
with
58 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ env: | |
jobs: | ||
# Check code formatting and static analysis on Ubuntu. | ||
analyze: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -42,3 +42,35 @@ jobs: | |
run: dart pub get | ||
- name: Run VM tests | ||
run: dart test --platform vm | ||
|
||
# release on Github and pub.dev | ||
publish: | ||
needs: test | ||
if: github.repository == 'casbin/dart-casbin' && github.event_name == 'push' | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: cedx/setup-dart@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
- run: npm install -g "@semantic-release/changelog" | ||
- run: npm install -g "@semantic-release/git" | ||
- run: npm install -g "pub-semantic-release" | ||
|
||
- name: Semantic Release | ||
run: | | ||
export NODE_PATH="$(npm root -g)" | ||
npx semantic-release@17 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish to pub | ||
run: dart pub publish --dry-run | ||
|
||
- uses: sakebook/[email protected] | ||
with: | ||
package_directory: ${{ matrix.package }} | ||
credential: ${{ secrets.PUB_CREDENTIALS }} | ||
flutter_package: true | ||
skip_test: true |
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,25 @@ | ||
{ | ||
"debug": true, | ||
"branches": [ | ||
"master" | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"pub-semantic-release", | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
"changelogFile": "CHANGELOG.md" | ||
} | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": ["pubspec.yaml", "CHANGELOG.md"], | ||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
} | ||
], | ||
"@semantic-release/github" | ||
] | ||
} |