chore: Create publish.yaml #28
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
name: test-and-relase | |
on: | |
push: | |
branches: | |
- +([0-9])?(.{+([0-9]),x}).x | |
- master | |
- main | |
- next | |
- next-major | |
- beta | |
- alpha | |
jobs: | |
test-and-release: | |
name: Test and Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🛑 Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.9.1 | |
with: | |
access_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v2 | |
- name: 🛤 Setup Java | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: '11' | |
- name: 🦋 Setup Flutter | |
uses: subosito/flutter-action@v1 | |
with: | |
flutter-version: '2.10.3' | |
channel: 'stable' | |
- name: 📦 Install dependencies | |
run: flutter pub get | |
- name: 🔔 Run unit test | |
run: flutter test | |
- name: 🚀 Release | |
uses: cycjimmy/semantic-release-action@v3 | |
id: semantic | |
with: | |
extra_plugins: | | |
@semantic-release/exec | |
@semantic-release/changelog | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PUB_DEV_PUBLISH_ACCESS_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }} | |
PUB_DEV_PUBLISH_EXPIRATION: ${{ secrets.PUB_DEV_PUBLISH_EXPIRATION }} | |
PUB_DEV_PUBLISH_REFRESH_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }} | |
PUB_DEV_PUBLISH_TOKEN_ENDPOINT: ${{ secrets.PUB_DEV_PUBLISH_TOKEN_ENDPOINT }} | |