Skip to content

Commit

Permalink
ci: Add automatic integration & publish workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
marianhlavac committed Sep 10, 2023
1 parent d1ce889 commit 1bf8e66
Show file tree
Hide file tree
Showing 3 changed files with 158 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Integration

on:
pull_request:
workflow_call:

env:
FLUTTER_VERSION: '3.13.x'

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: Install the project
uses: dronetag/gha-shared/.github/actions/flutter-install@master
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Run code analysis
run: flutter analyze --no-fatal-infos

# test:
# name: Run unit tests suite
# runs-on: ubuntu-22.04
# timeout-minutes: 5
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# - name: Install the project
# uses: dronetag/gha-shared/.github/actions/flutter-install@master
# with:
# flutter-version: ${{ env.FLUTTER_VERSION }}
# - name: Run test suite
# run: flutter test -r expanded
60 changes: 60 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Publish to pub.dev

# Publish workflow releases a new version, updates changelog
# and publishes the library to pub.dev

on:
push:
branches:
- master

env:
FLUTTER_VERSION: '3.13.x'

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: Install the project
uses: dronetag/gha-shared/.github/actions/flutter-install@master
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Publish to pub.dev
run: flutter pub publish -f
61 changes: 61 additions & 0 deletions .releaserc
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"
]
}
]
]
}

0 comments on commit 1bf8e66

Please sign in to comment.