-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (50 loc) · 1.8 KB
/
BuildModule.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
name: BuildModule
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Fetch tags for GitVersion
run: git fetch --prune
- name: Run GitVersion
# You may pin to the exact commit or the version.
# uses: roryprimrose/rungitversion@80f02b02c55975abac3836750542fe3d596c2cf4
uses: roryprimrose/[email protected]
with:
# "true" to use GitVersion /nofetch, any other value to enable fetch
nofetch: false # default is false
# "true" to use GitVersion /nocache, any other value to enable cache
nocache: false # default is false
# - name: Install GitVersion
# uses: gittools/actions/gitversion/[email protected]
# with:
# versionSpec: '5.6.x'
# - name: Use GitVersion
# id: gitversion
# uses: gittools/actions/gitversion/[email protected]
- name: Setup cache for build dependencies
id: cacheBuildDependencies
uses: actions/cache@v2
with:
path: tmp/Modules
key: ${{ hashFiles('Scripts/DownloadBuildDependencies.ps1') }}
- name: Download required build dependencies
if: steps.cacheBuildDependencies.outputs.cache-hit != 'true'
shell: pwsh
run: ./Scripts/DownloadBuildDependencies.ps1
- name: Build Module
run: |
$ModulePath = Resolve-Path -Path tmp/Modules | Select-Object -ExpandProperty Path
$Env:PSModulePath = $ModulePath, $Env:PSModulePath -join [System.IO.Path]::PathSeparator
Import-Module ModuleBuilder
Build-Module -SourcePath .\Source -SemVer ${{ steps.gitversion.outputs.SemVer }}
shell: pwsh
- name: Upload built module
uses: actions/upload-artifact@v2
with:
name: MyTesla
path: bin/MyTesla