Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(workflows): combine semantic release into main workflow #148

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
56 changes: 52 additions & 4 deletions .github/workflows/github_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ on:
branches:
- main
pull_request:
workflow_dispatch:
schedule:
- cron: "0 0 * * SUN"

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

jobs:
test:
Expand All @@ -16,14 +23,15 @@ jobs:
uses: actions/checkout@v4

- name: Get project Flutter version 🏷️
id: fvm-config
uses: kuhnroyal/flutter-fvm-config-action@v1

- name: Setup Flutter 💻
uses: subosito/flutter-action@v2.10.0
with:
channel: ${{ env.FLUTTER_CHANNEL }}
channel: ${{ steps.fvm-config.outputs.FLUTTER_CHANNEL }}
cache: true
cache-key: ${{ runner.os }}-flutter-${{ env.FLUTTER_CHANNEL }}
cache-key: ${{ runner.os }}-flutter-${{ steps.fvm-config.outputs.FLUTTER_CHANNEL }}

- name: Run tests 🧪
run: |
Expand All @@ -42,14 +50,15 @@ jobs:
uses: actions/checkout@v4

- name: Get project Flutter version 🏷️
id: fvm-config
uses: kuhnroyal/flutter-fvm-config-action@v1

- name: Setup Flutter 💻
uses: subosito/flutter-action@v2.10.0
with:
channel: ${{ env.FLUTTER_CHANNEL }}
channel: ${{ steps.fvm-config.outputs.FLUTTER_CHANNEL }}
cache: true
cache-key: ${{ runner.os }}-flutter-${{ env.FLUTTER_CHANNEL }}
cache-key: ${{ runner.os }}-flutter-${{ steps.fvm-config.outputs.FLUTTER_CHANNEL }}

- name: Run linting 🧪
run: |
Expand Down Expand Up @@ -83,3 +92,42 @@ jobs:
echo The score $PERCENTAGE is too low, it must be at least 90
exit 1
fi

semantic-release:
name: Semantic release
runs-on: ubuntu-latest
needs: [test, lint, analyze]
if: ${{ (github.ref == 'refs/heads/main') && (contains(fromJSON('["workflow_dispatch", "schedule"]'), github.event_name)) }}

steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Get project Flutter version 🏷️
id: fvm-config
uses: kuhnroyal/flutter-fvm-config-action@v1.2.0

- name: Setup Flutter 💻
uses: subosito/flutter-action@v2.10.0
with:
channel: ${{ steps.fvm-config.outputs.FLUTTER_CHANNEL }}
cache: true
cache-key: ${{ runner.os }}-flutter-${{ steps.fvm-config.outputs.FLUTTER_CHANNEL }}

- name: Setup Node 💻
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn

- name: Install dependencies 📦
run: yarn

- name: Release 🚀
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
GOOGLE_SERVICE_ACCOUNT_KEY: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}
49 changes: 0 additions & 49 deletions .github/workflows/semantic-release.yml

This file was deleted.