ci: implement automated versioning #2
Workflow file for this run
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: version | |
on: | |
pull_request: | |
types: | |
- closed | |
branches: | |
- dev | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
version_and_tag: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.merged == true && !contains(github.event.pull_request.title, 'chore(version)') | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@v4 | |
with: | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Setup Git User | |
uses: fregante/setup-git-user@v2 | |
- name: Set SSH Key | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{secrets.SSH_PRIVATE_KEY}} | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
flutter-version: "3.10.2" | |
cache: true | |
- name: Setup Melos | |
uses: bluefireteam/melos-action@v1 | |
with: | |
melos-version: "3.0.1" | |
- name: Create git tag based on version | |
run: melos version --yes | |
- name: Get latest tag | |
run: | | |
echo tag=$(git describe --tags `git rev-list --tags --max-count=1`) >> $GITHUB_OUTPUT | |
id: get-latest-tag | |
- name: Push tag | |
run: git push origin ${{ steps.get-latest-tag.outputs.tag }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Pull Request on updated changelog and pubspec file. | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ secrets.PAT }} | |
title: "chore(version): bump version and update changelog" | |
base: dev |