Skip to content

Merge pull request #3964 from Lou-i3/patch-1 #325

Merge pull request #3964 from Lou-i3/patch-1

Merge pull request #3964 from Lou-i3/patch-1 #325

Workflow file for this run

name: Release Modern Search Web Parts SPFx package
on:
workflow_dispatch:
inputs:
create_release:
default: true
description: "Create GiHub release?"
push:
branches:
- main
- "release/**"
- develop
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: search-parts
strategy:
matrix:
node-version: [18.x]
outputs:
majorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}
semver: ${{ steps.gitversion.outputs.semver }}
branchName: ${{ steps.gitversion.outputs.branchName }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: "6.x"
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
- name: Build SPFx
run: |
pnpm install
gulp update-version --value $GITVERSION_MAJORMINORPATCH
gulp update-package-name --name pnp-modern-search-parts-$GITVERSION_SEMVER
gulp bundle --ship
gulp package-solution --ship
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: pnp-modern-search-parts-v4
path: ${{ github.workspace }}/**/*.sppkg
retention-days: 1
overwrite: false
compression-level: 0
release:
runs-on: ubuntu-latest
environment: production
needs: build
if: contains(needs.build.outputs['branchName'], 'main')
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
- name: Create GitHub release
uses: ncipollo/release-action@v1
with:
name: PnP Modern Search - ${{ needs.build.outputs.semver }}
artifacts: ${{ github.workspace }}/**/*.sppkg
bodyFile: ".github/workflows/release-template.md"
draft: true
generateReleaseNotes: true
allowUpdates: true
replacesArtifacts: true
prerelease: ${{ startsWith(github.ref_name, 'release') }}
tag: ${{ needs.build.outputs.majorMinorPatch }}
commit: ${{ github.ref_name }}
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Deploy documentation
run: |
pip install markdown-include
pip install mkdocs-material==7.2.4
mkdocs gh-deploy --force