feat: add new commands & support for calVer #19
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: Bump Version | |
on: | |
pull_request: | |
branches: ["master"] | |
types: [closed] | |
jobs: | |
verify-merge: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 🛂 Ensure pull request was merged | |
if: ${{ github.event.pull_request.merged != true }} | |
run: exit 1 | |
update-version: | |
needs: verify-merge | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref }} | |
fetch-depth: 0 | |
token: ${{ secrets.VERSION_VERIFY }} | |
- name: 🌽 Corn-figure Git ;) | |
id: corn-fig-git | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.BOT_GPG_KEY }} | |
git_config_global: true | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
git_tag_gpgsign: true | |
- name: 🎯 Setup Dart | |
uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: "stable" | |
- name: 🔍 Extract target | |
id: extract-target | |
uses: kekavc24/magical_workflows/.github/actions/extract_target@v3.0.0 | |
with: | |
major: ${{contains(github.event.pull_request.labels.*.name, 'major release')}} | |
minor: ${{contains(github.event.pull_request.labels.*.name, 'minor release')}} | |
patch: ${{contains(github.event.pull_request.labels.*.name, 'patch release')}} | |
bump_build: false | |
- name: ✨ Bump version | |
uses: kekavc24/magical_workflows/.github/actions/bump_version@v3.0.0 | |
with: | |
targets: ${{ steps.extract-target.outputs.target }} | |
use-pub: false | |
- name: 🧬 Generate new asset graph | |
run: dart run build_runner build --delete-conflicting-outputs | |
- name: 🔍 Get version | |
id: get-version | |
uses: kekavc24/magical_workflows/.github/actions/extract_version@v3.0.0 | |
with: | |
path: 'pubspec.yaml' | |
- name: 🆕 Commit & Tag | |
run: | | |
git commit -am "chore: v${{steps.get-version.outputs.version}}" | |
git tag -a ${{steps.get-version.outputs.version}} HEAD -m "v${{steps.get-version.outputs.version}}" | |
git push | |
git push origin ${{steps.get-version.outputs.version}} | |
env: | |
GIT_AUTHOR_NAME: ${{ steps.corn-fig-git.outputs.name }} | |
GIT_AUTHOR_EMAIL: ${{ steps.corn-fig-git.outputs.email }} | |
GIT_COMMITTER_NAME: ${{ steps.corn-fig-git.outputs.name }} | |
GIT_COMMITTER_EMAIL: ${{ steps.corn-fig-git.outputs.email }} | |
- name: ✅ Verify version | |
run: | | |
git pull | |
dart pub get | |
dart run test --run-skipped -t version-verify |