-
Notifications
You must be signed in to change notification settings - Fork 340
112 lines (94 loc) · 3.07 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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: [14.x]
outputs:
majorMinorPatch: ${{ steps.setoutputs.outputs.majorMinorPatch }}
semver: ${{ steps.setoutputs.outputs.semver }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: '5.x'
- name: Setup pnpm
uses: pnpm/action-setup@v2.2.2
with:
version: 7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7
- name: Set outputs
id: setoutputs
run: |
echo "::set-output name=majorMinorPatch::$GITVERSION_MAJORMINORPATCH"
echo "::set-output name=semver::$GITVERSION_SEMVER"
- 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@v3
with:
name: pnp-modern-search-parts-${{ steps.gitversion.outputs.semVer }}
path: ${{ github.workspace }}/**/*.sppkg
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@v3
with:
fetch-depth: 0
- uses: actions/download-artifact@v3
with:
name: pnp-modern-search-parts-${{ needs.build.outputs.semver }}
- 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@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