Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

🔄 synced file(s) with tiki/internal-repo-sync #37

🔄 synced file(s) with tiki/internal-repo-sync

🔄 synced file(s) with tiki/internal-repo-sync #37

Workflow file for this run

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
steps:
- 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: Set Version
run: |
sed -i '3 s/version = *.*.*/version = "${{ steps.semver.outputs.nextStrict }}"/' endpoint/Cargo.toml
sed -i '3 s/version = *.*.*/version = "${{ steps.semver.outputs.nextStrict }}"/' schema/Cargo.toml
sed -i 's/"version": "*.*.*"/"version": "${{ steps.semver.outputs.nextStrict }}"/' package.json
- name: Commit Changes
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "GH Action"
git add endpoint/Cargo.toml
git add schema/Cargo.toml
git commit -m 'version bump'
git push
outputs:
version: ${{ steps.semver.outputs.nextStrict }}