dist update #892
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: pwsh | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ windows-latest, ubuntu-latest, macos-13, macos-14 ] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
with: | |
token: ${{ secrets.PUSH_GITHUB_TOKEN }} | |
- uses: actions/checkout@v4 | |
if: github.event_name == 'pull_request' | |
- name: Fetch all history for all tags and branches | |
run: | | |
git fetch --prune --unshallow | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- run: | | |
npm install | |
npm run format-check | |
npm run build:agent:github | |
npm run build:agent:azure | |
name: Build code | |
- name: gitversion/setup | |
uses: ./gitversion/setup | |
with: | |
versionSpec: '5.x' | |
- name: gitversion/execute | |
id: gitversion # step id used as reference for output values | |
uses: ./gitversion/execute | |
with: | |
targetPath: './' | |
disableCache: true | |
disableNormalization: false | |
overrideConfig: | | |
update-build-number=false | |
- run: | | |
echo "Major (major) : ${{ env.major }}" | |
echo "Major (env.GitVersion_Major) : ${{ env.GitVersion_Major }}" | |
echo "Major (steps.gitversion.outputs.major) : ${{ steps.gitversion.outputs.major }}" | |
echo "Major (steps.gitversion.outputs.GitVersion_Major) : ${{ steps.gitversion.outputs.GitVersion_Major }}" | |
echo "Minor (minor) : ${{ env.minor }}" | |
echo "Minor (env.GitVersion_Minor) : ${{ env.GitVersion_Minor }}" | |
echo "Minor (steps.gitversion.outputs.minor) : ${{ steps.gitversion.outputs.minor }}" | |
echo "Minor (steps.gitversion.outputs.GitVersion_Minor) : ${{ steps.gitversion.outputs.GitVersion_Minor }}" | |
echo "Patch (patch) : ${{ env.patch }}" | |
echo "Patch (env.GitVersion_Patch) : ${{ env.GitVersion_Patch }}" | |
echo "Patch (steps.gitversion.outputs.patch) : ${{ steps.gitversion.outputs.patch }}" | |
echo "Patch (steps.gitversion.outputs.GitVersion_Patch) : ${{ steps.gitversion.outputs.GitVersion_Patch }}" | |
echo "FullSemVer (env.fullSemVer) : ${{ env.fullSemVer }}" | |
echo "FullSemVer (env.GitVersion_FullSemVer) : ${{ env.GitVersion_FullSemVer }}" | |
echo "FullSemVer (steps.gitversion.outputs.fullSemVer) : ${{ steps.gitversion.outputs.fullSemVer }}" | |
echo "FullSemVer (steps.gitversion.outputs.GitVersion_FullSemVer) : ${{ steps.gitversion.outputs.GitVersion_FullSemVer }}" | |
name: Use variables and output | |
- name: Check for changes | |
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push' | |
id: status | |
run: | | |
if ($null -ne (git status --porcelain)) { echo "has_changes=1"; echo "has_changes=1" >> $env:GITHUB_OUTPUT } | |
- name: Rebuild dist and push | |
run: | | |
git add --verbose . | |
git config user.name 'Artur' | |
git config user.email 'arturcic@gmail.com' | |
git commit -m 'dist update' --allow-empty | |
git push --force | |
if: steps.status.outputs.has_changes == '1' |