Skip to content

Commit

Permalink
cascade change
Browse files Browse the repository at this point in the history
  • Loading branch information
whichwit authored Nov 5, 2023
1 parent 8650848 commit f5dbf9a
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows-old/versionize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Versionize
on:
push:
branches:
- master
workflow_dispatch:
jobs:
versionize:
name: versionize each project
runs-on: ubuntu-latest
needs: assess
strategy:
matrix:
proj: [VRDR,VRDR.CLI]
steps:
- run: echo ${{ matrix.proj }}


assess:
runs-on: ubuntu-latest
outputs:
proj: ${{ steps.proj_filter.outputs.PROJ }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git diff-tree HEAD
- name: Filter list of changed projects
id: proj_filter
run: echo "PROJ=$(git diff-tree HEAD | awk '$1$2~/04/' | cut -f2- | egrep 'VRDR.CLI|VRDR')" >> "$GITHUB_OUTPUT"
84 changes: 84 additions & 0 deletions .github/workflows/versionize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Versionize
on:
push:
branches:
- master
workflow_dispatch:

permissions:
contents: 'write'
pull-requests: 'write'

jobs:
scope:
runs-on: ubuntu-latest
# strategy:
# matrix:
# proj: [VRDR,VRDR.CLI,BFDR]
outputs:
projs: ${{ steps.proj_filter.outputs.projs }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
# - run: echo ${{ matrix.proj }}
# - name: Filter list of changed projects
# id: proj_filter
# run: echo "PROJ=$(git diff-tree HEAD | awk '$1$2~/04/' | cut -f2- | grep '^${{ matrix.proj }}$')" >> "$GITHUB_OUTPUT"
- name: Filter list of changed projects
id: proj_filter
run: |
echo "projs=$(git diff-tree HEAD | awk '$1$2~/04/' | cut -f2- | grep -e ^VRDR$ -e ^VRDR.Client$ | jq -cnR '[inputs | select(length>0)]')" >> "$GITHUB_OUTPUT"
# - name: Advance project version
# if: steps.proj_filter.outputs.PROJ == matrix.proj
# run: echo "wee~"
versionize:
runs-on: ubuntu-latest
needs: scope
strategy:
fail-fast: false
matrix:
proj: ${{ fromJson(needs.scope.outputs.projs) }}
steps:
- run: echo ${{ matrix.proj }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Setup Versionize
run: |
dotnet tool install --global Versionize
- run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Bump version and create changelog
run: |
versionize --proj-version-bump-logic --skip-tag --changelog-all -w ${{ matrix.proj }}
- name: Get current version
id: get-version
run: |
echo "version=$(versionize inspect)" >> $GITHUB_OUTPUT
- name: Create release Pull Request
uses: peter-evans/create-pull-request@v5
id: cpr
with:
token: ${{ secrets.WHICHWIT_BOT_TOKEN }}
commit-message: |
chore: ${{ matrix.proj }} ${{ steps.get-version.outputs.version }}
title: |
chore: ${{ matrix.proj }} ${{ steps.get-version.outputs.version }}
body: ""
branch: versionize-${{ matrix.proj }}
reviewers: ${{ github.actor }}
delete-branch: true


# job2:
# runs-on: ubuntu-latest
# needs: versionize
# if: needs.versionize.outputs.proj != ''
# steps:
# - run: ls
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>3.2.3</Version>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp6.0</TargetFramework>
<TargetFrameworks>netcoreapp6.0</TargetFrameworks>
Expand Down
Empty file added VRDR.CLI/b
Empty file.
Empty file added VRDR.Client/c
Empty file.
Empty file added VRDR/d/a2
Empty file.

0 comments on commit f5dbf9a

Please sign in to comment.