-
Notifications
You must be signed in to change notification settings - Fork 16
133 lines (113 loc) · 4.4 KB
/
ci-releases.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: CI (releases/*)
on:
push:
branches:
- releases/1.10
paths:
- 'SharePointFramework/**'
- 'Install/**'
- 'Templates/**'
- .github/workflows/ci-releases.yml
env:
SP_URL: 'https://puzzlepart.sharepoint.com/sites/pp365'
CI_CERT_BASE64: ${{ secrets.CI_CERT_BASE64 }}
CI_TENANT: ${{ secrets.CI_TENANT }}
CI_CLIENT_ID: ${{ secrets.CI_CLIENT_ID }}
jobs:
build_release_package:
name: Build release package
runs-on: macos-latest
if: ${{ !contains(github.event.head_commit.message, '[skip-ci]') && !contains(github.event.head_commit.message, '[packages-only]') }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Set sha_short
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- uses: actions/setup-node@v3
with:
node-version: ${{ vars.NODE_VERSION }}
- name: Run Install/Build-Release.ps1 in CI mode
run: Install/Build-Release.ps1 -CI -SkipBundle
shell: pwsh
- uses: actions/upload-artifact@v3
with:
name: release-package
path: release
outputs:
sha_short: ${{ steps.vars.outputs.sha_short }}
upgrade:
needs: [build_release_package]
name: Upgrade
runs-on: macos-latest
if: ${{ !contains(github.event.head_commit.message, '[skip-upgrade]') }}
steps:
- uses: actions/download-artifact@v3
with:
name: release-package
path: release
- name: Upgrade
run: release/Install.ps1 -Url ${{ env.SP_URL }} -Upgrade -CI -Tenant ${{ env.CI_TENANT }} -CertificateBase64Encoded ${{ env.CI_CERT_BASE64 }} -ClientId ${{ env.CI_CLIENT_ID }}
shell: powershell
install:
needs: [build_release_package, upgrade]
name: Install
runs-on: macos-latest
if: ${{ !contains(github.event.head_commit.message, '[skip-install]') }}
steps:
- uses: actions/download-artifact@v3
with:
name: release-package
path: release
- name: Install
run: release/Install.ps1 -Url "${{ env.SP_URL }}_${{ needs.build_release_package.outputs.sha_short }}" -Title "Prosjektportalen 365 ${{ needs.build_release_package.outputs.sha_short }}" -CI -Tenant ${{ env.CI_TENANT }} -CertificateBase64Encoded ${{ env.CI_CERT_BASE64 }} -ClientId ${{ env.CI_CLIENT_ID }} -SkipAppPackages -SkipSiteDesign -SkipTaxonomy -SkipSearchConfiguration
shell: powershell
upgrade_all_sites_to_latest:
needs: [build_release_package, upgrade]
name: Upgrade all sites to latest
runs-on: macos-latest
if: ${{ contains(github.event.head_commit.message, '[upgrade-all-sites-to-latest]') }}
steps:
- uses: actions/download-artifact@v3
with:
name: release-package
path: release
- name: Run script UpgradeAllSitesToLatest.ps1 in CI mode
run: release/Scripts/UpgradeAllSitesToLatest.ps1 -Url ${{ env.SP_URL }} -CI -Tenant ${{ env.CI_TENANT }} -CertificateBase64Encoded ${{ env.CI_CERT_BASE64 }} -ClientId ${{ env.CI_CLIENT_ID }}
shell: powershell
build_release_package_packages_only:
name: Build release package - packages only
runs-on: macos-latest
if: ${{ contains(github.event.head_commit.message, '[packages-only]') }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Set sha_short
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- uses: actions/setup-node@v3
with:
node-version: ${{ vars.NODE_VERSION }}
- name: Run Install/Build-Release.ps1 in CI mode
run: Install/Build-Release.ps1 -CI -SkipBundle -SkipBuildPnPTemplates
shell: pwsh
- uses: actions/upload-artifact@v3
with:
name: release-package
path: release
outputs:
sha_short: ${{ steps.vars.outputs.sha_short }}
upgrade_packages_only:
needs: [build_release_package_packages_only]
name: Upgrade packages only
runs-on: macos-latest
steps:
- uses: actions/download-artifact@v3
with:
name: release-package
path: release
- name: Upgrade
run: release/Install.ps1 -Url ${{ env.SP_URL }} -Upgrade -CI -Tenant ${{ env.CI_TENANT }} -CertificateBase64Encoded ${{ env.CI_CERT_BASE64 }} -ClientId ${{ env.CI_CLIENT_ID }} -SkipTemplate
shell: powershell