Repository navigation
90 lines (87 loc) · 3.01 KB
/
Copy pathrelease.yaml
File metadata and controls
90 lines (87 loc) · 3.01 KB
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
---
name: release
on:
workflow_dispatch:
inputs:
publish_to:
description: 'Where to publish the release to'
required: true
default: '"nuget", "PSGallery", "GitHub"'
type: string
permissions: {}
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
# Step 1: Generate a short-lived token from the GitHub App
- name: generate-app-token
id: app-token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3
with:
app-id: ${{ secrets.BROWNSERVE_CI_APP_ID }}
private-key: ${{ secrets.BROWNSERVE_CI_APP_PRIVATE_KEY }}
# Step 2: Checkout the repo
- name: checkout-module
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: PSSourceControl
# Step 3: Install Mono (required to run NuGet.exe on Linux)
- name: install-mono
run: sudo apt-get install -y mono-complete
# Step 4: Run the build script
- name: run-build-script
shell: pwsh
env:
GitHubToken: ${{ steps.app-token.outputs.token }}
NugetFeedAPIKey: ${{ secrets.NUGET_API_KEY }}
PSGalleryAPIKey: ${{ secrets.POWERSHELL_GALLERY_API_KEY }}
run: |
$Params = @{
BranchName = $env:GITHUB_REF
GitHubRepoName = 'PSSourceControl'
Build = 'Release'
GitHubReleaseToken = $env:GitHubToken
NugetFeedApiKey = $env:NugetFeedAPIKey
PSGalleryAPIKey = $env:PSGalleryAPIKey
PublishTo = ${{ inputs.publish_to }}
Verbose = $true
}
./PSSourceControl/.build/build.ps1 @Params
# Step 5: Push a notification to Slack
- name: notify-slack
shell: pwsh
if: ${{ always() }}
env:
BUILD_NOTIFICATION_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_BUILD }}
BUILD_BRANCH: ${{ github.ref }}
run: |
./PSSourceControl/.build/_init.ps1
Send-BuildNotification `
-BuildName ${{ github.job }} `
-BuildStatus ${{ job.status }} `
-Webhook $env:BUILD_NOTIFICATION_WEBHOOK `
-RepoBranch $env:BUILD_BRANCH `
-RepoName $global:BrownserveRepoName
deploy-docs:
name: Deploy documentation
needs: [release]
runs-on: ubuntu-latest
permissions:
contents: write # needed for gh-deploy to push to gh-pages branch
steps:
# Step 1: Checkout the repo
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
# Step 2: Set up Python
- name: setup-python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v6
with:
python-version: '3.x'
# Step 3: Install MkDocs and build/deploy the site
- name: deploy-docs
run: |
pip install -r requirements.txt
mkdocs gh-deploy --force