Skip to content

Commit

Permalink
ci(workflows): combine semantic release into main workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zeshuaro committed Sep 21, 2023
1 parent 1f5de51 commit eb7057a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 53 deletions.
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.

0 comments on commit eb7057a

Please sign in to comment.