Ionite
1 year ago
committed by
GitHub
1 changed files with 68 additions and 0 deletions
@ -0,0 +1,68 @@
|
||||
name: Version Bump |
||||
|
||||
on: |
||||
pull_request: |
||||
types: [closed] |
||||
branches: ["main"] |
||||
|
||||
workflow_dispatch: |
||||
inputs: |
||||
version_mask: |
||||
type: string |
||||
description: Version Bump Mask |
||||
default: "0.0.1.0" |
||||
required: false |
||||
|
||||
version_overwrite: |
||||
type: string |
||||
description: Version Overwrite Mask |
||||
default: "*.*.*.*" |
||||
required: false |
||||
|
||||
jobs: |
||||
version-bump: |
||||
# Run on PR merge or manual trigger |
||||
if: | |
||||
github.event_name == 'workflow_dispatch' || ( |
||||
github.event_name == 'pull_request' && github.event.pull_request.merged == true |
||||
) |
||||
runs-on: windows-latest |
||||
steps: |
||||
# Manual Mode |
||||
- name: Manual Version Mask |
||||
if: github.event_name == 'workflow_dispatch' |
||||
run: | |
||||
echo "version_mask=${{ github.event.inputs.version_mask }}" >> "$GITHUB_ENV" |
||||
echo "version_overwrite=${{ github.event.inputs.version_overwrite }}" >> "$GITHUB_ENV" |
||||
|
||||
# On PR Labels |
||||
- name: Set Overwrite Mask |
||||
if: github.event_name == 'pull_request' |
||||
run: | |
||||
echo "version_overwrite=*.*.*.*" >> "$GITHUB_ENV" |
||||
|
||||
- name: Label Major Version Mask |
||||
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Bump Major') |
||||
run: echo "version_mask=1.0.0.0" >> "$GITHUB_ENV" |
||||
|
||||
- name: Label Minor Version Mask |
||||
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Bump Minor') |
||||
run: echo "version_mask=0.1.0.0" >> "$GITHUB_ENV" |
||||
|
||||
- name: Label Patch Version Mask |
||||
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Bump Patch') |
||||
run: echo "version_mask=0.0.1.0" >> "$GITHUB_ENV" |
||||
|
||||
- uses: actions/checkout@v3 |
||||
- name: Setup .NET Core |
||||
uses: actions/setup-dotnet@v2 |
||||
with: |
||||
dotnet-version: 6.0.x |
||||
|
||||
- name: Bump versions |
||||
uses: SiqiLu/dotnet-bump-version@2.1.0 |
||||
with: |
||||
version_files: "**/*.csproj" |
||||
version_mask: ${{ env.version_mask }} |
||||
version_overwrite: ${{ env.version_overwrite }} |
||||
github_token: ${{ secrets.GITHUB_TOKEN }} |
Loading…
Reference in new issue