Skip to content

Commit

Permalink
Merge pull request #13 from syaiful-aa/ci/up
Browse files Browse the repository at this point in the history
title up
  • Loading branch information
syaiful-aa authored Jun 28, 2024
2 parents 3796061 + 20f27f6 commit afe394d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/update-main-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ jobs:

- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
ref: ${{ github.event.pull_request.merge_commit_sha }}

- name: Get version
id: get-version
run: |
git fetch origin main
prev_version=$(git show main:pubspec.yaml | grep 'version:' | cut -d ':' -f2 | sed 's/ //' | cut -d'+' -f1)
prev_version=$(git show origin/main:pubspec.yaml | grep 'version:' | cut -d ':' -f2 | sed 's/ //' | cut -d'+' -f1)
echo "prev_version=$prev_version" >> $GITHUB_OUTPUT
full_version=$(cat pubspec.yaml | grep 'version' | cut -d ':' -f2 | sed 's/ //' | cut -d'+' -f1)
Expand All @@ -45,12 +45,17 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
ref: ${{ github.event.pull_request.merge_commit_sha }}

- name: Tag new target
run: |
git tag -f v${{ needs.validate_version.outputs.full_version }} ${{ github.event.pull_request.head.sha }}
git tag -f v${{ needs.validate_version.outputs.major_version }} ${{ github.event.pull_request.head.sha }}
git config user.email "[email protected]"
git config user.name "GitHub Action"
message="${{ github.event.pull_request.title }}"
git tag -f v${{ needs.validate_version.outputs.full_version }} -m $message
git tag -f v${{ needs.validate_version.outputs.major_version }} -m $message
- name: Push new tag
run: |
Expand Down

0 comments on commit afe394d

Please sign in to comment.