Skip to content

Commit

Permalink
feat: add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
clragon committed Jan 6, 2024
1 parent 6dfb6e0 commit c3fd740
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: "Version to bump"
required: true
type: choice
options:
- major
- minor
- patch

env:
VERSION_BUMP: ${{ github.event.inputs.version }}

jobs:
release:
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- name: Setup actions
uses: actions/checkout@v3

- name: Setup flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true

- name: Setup cider
run: dart pub global activate cider

- name: Install dependencies
run: flutter pub get

- name: Run tests
run: flutter test

- name: Bump and release version
run: |
cider bump ${{ env.VERSION_BUMP }}
cider release
- name: Get new version
run: echo "VERSION=$(cider version)" >> $GITHUB_ENV

- name: Commit version increase
uses: EndBug/add-and-commit@v9
with:
message: "chore: increase version"
default_author: github_actions
add: |
pubspec.yaml
CHANGELOG.md
- name: Get version changelog
run: |
echo "CHANGELOG=$(cider describe ${{ env.VERSION }} --only-body)" >> $GITHUB_ENV
- name: Create release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
body: ${{ env.CHANGELOG }}

0 comments on commit c3fd740

Please sign in to comment.