repo: update CI/CD scripts #58
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: | ||
push: | ||
branches: [ "main" ] | ||
jobs: | ||
detect-version: | ||
name: Detect new version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Setup .NET Core SDK | ||
uses: actions/setup-dotnet@v2 | ||
with: dotnet-version: '5.0.x' | ||
- name: Setup git | ||
run: | | ||
git config user.email "$(git log -1 --pretty=format:%ae)" | ||
git config user.name "$(git log -1 --pretty=format:%an)" | ||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/setup@v0.9.13 | ||
with: versionSpec: '5.x' | ||
- name: Determine Version | ||
id: execute | ||
uses: gittools/actions/gitversion/execute@v0.9.13 | ||
outputs: | ||
newVersion: ${{ steps.execute.outputs.majorMinorPatch }} | ||
bump-package: | ||
name: Bump package version | ||
runs-on: ubuntu-latest | ||
needs: detect-version | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: node-version: 20 | ||
- name: Setup git | ||
run: | | ||
git config user.email "$(git log -1 --pretty=format:%ae)" | ||
git config user.name "$(git log -1 --pretty=format:%an)" | ||
- name: Bump version | ||
run: | | ||
git tag v${{ needs.detect-version.outputs.newVersion }} | ||
cd frontend | ||
npm --no-git-tag-version version ${{ needs.detect-version.outputs.newVersion }} | ||
cd .. | ||
git add . | ||
git commit -m "bump: \`${{ needs.detect-version.outputs.newVersion }}\`" | ||
git push | ||
git push --tags |