-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (56 loc) · 2.1 KB
/
Copy pathBuild-Module.yml
File metadata and controls
62 lines (56 loc) · 2.1 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
name: Build-Module
on:
workflow_call:
secrets:
GitHubAppClientId:
description: The client ID of the GitHub App used for repository API calls.
required: true
GitHubAppPrivateKey:
description: The private key of the GitHub App used for repository API calls.
required: true
inputs:
Settings:
type: string
description: The settings object as a JSON string.
required: true
ArtifactName:
type: string
description: Name of the artifact to upload.
required: false
default: module
permissions:
contents: read # to checkout the repository
jobs:
Build-Module:
name: Build-Module
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
fetch-depth: 0
- name: Checkout Process-PSModule
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: ${{ job.workflow_repository }}
ref: ${{ job.workflow_sha }}
path: _wf
persist-credentials: false
- name: Create GitHub App token
id: App-Token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ secrets.GitHubAppClientId }}
private-key: ${{ secrets.GitHubAppPrivateKey }}
repositories: ${{ github.event.repository.name }}
- name: Build module
uses: ./_wf/.github/actions/Build-PSModule
env:
GH_TOKEN: ${{ steps.App-Token.outputs.token }}
with:
Name: ${{ fromJson(inputs.Settings).Name }}
Version: ${{ fromJson(inputs.Settings).Publish.Module.Resolution.Version != '' && fromJson(inputs.Settings).Publish.Module.Resolution.Version || '999.0.0' }}
Prerelease: ${{ fromJson(inputs.Settings).Publish.Module.Resolution.Prerelease }}
ArtifactName: ${{ inputs.ArtifactName }}
WorkingDirectory: ${{ fromJson(inputs.Settings).WorkingDirectory }}