Skip to content

Update release yml -test #303

Update release yml -test

Update release yml -test #303

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.setoutputs.outputs.majorMinorPatch }}
semver: ${{ steps.setoutputs.outputs.semver }}
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: Set outputs
id: setoutputs
run: |
echo "majorMinorPatch=$GITVERSION_MAJORMINORPATCH" >> $GITHUB_OUTPUT
echo "semver=$GITVERSION_SEMVER" >> $GITHUB_OUTPUT
- 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-${{ steps.gitversion.outputs.semver }}
path: ${{ github.workspace }}/**/*.sppkg
retention-days: 1
overwrite: true
release:
runs-on: ubuntu-latest
environment: production
if: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release') || github.event.inputs.create_release }}
needs: build
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.steps.gitversion.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.steps.gitversion.outputs.majorMinorPatch }}
commit: ${{ github.ref_name }}
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Deploy documentation
run: |
pip install markdown-include
pip install mkdocs-material==7.2.4
mkdocs gh-deploy --force