This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
fix: update project #9
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: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
version: | |
if: startsWith(github.head_ref, 'release/') | |
runs-on: ubuntu-latest | |
outputs: | |
tag: ${{ steps.semver.outputs.nextStrict }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Checkout PR | |
id: getpr | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
run: | | |
gh pr checkout ${{ github.event.pull_request.number }} | |
export PR_BRANCH=$(git branch --show-current) | |
echo "branch=$PR_BRANCH" >> $GITHUB_OUTPUT | |
- name: Get Version | |
id: semver | |
uses: ietf-tools/semver-action@v1 | |
with: | |
token: ${{ github.token }} | |
branch: ${{ steps.getpr.outputs.branch }} | |
- name: Update Podspec | |
run: | | |
sed -i 's/${{ steps.semver.outputs.current }}/${{ steps.semver.outputs.nextStrict }}/' TikiClient.podspec | |
sed -i 's/${{ steps.semver.outputs.current }}/${{ steps.semver.outputs.nextStrict }}/' README.md | |
- name: Commit Changes | |
continue-on-error: true | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GH Action" | |
git add TikiClient.podspec | |
git add README.md | |
git commit -m 'ci: version bump' | |
git push |