-
-
Notifications
You must be signed in to change notification settings - Fork 54
120 lines (94 loc) · 3.28 KB
/
ci.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
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: ["master"]
schedule:
- cron: "0 0 * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
# This workflow contains a single job called "build"
build:
name: Build
runs-on: windows-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
DOTNET_ADD_GLOBAL_TOOLS_TO_PATH: false
DOTNET_MULTILEVEL_LOOKUP: 0
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: true
TERM: xterm
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
Configuration: Release
steps:
- uses: actions/checkout@v4
with:
repository: "flcdrg/au-dotnet"
path: "autoupdate"
persist-credentials: false
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.200
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.nuget/packages
key: ${{ runner.os }}-dotnet-${{ hashFiles('autoupdate/AutoUpdate/*.csproj') }}
restore-keys: |
${{ runner.os }}-dotnet-
- name: Restore
run: dotnet restore
working-directory: autoupdate
- name: Build
run: dotnet build --no-restore
working-directory: autoupdate
- name: Test
run: dotnet test
working-directory: autoupdate
- uses: actions/checkout@v4
with:
repository: "flcdrg/chocolatey-au"
path: "chocolatey-au"
ref: "simplify"
persist-credentials: false
- name: Install
run: |
$module_name = 'Chocolatey-AU'
$module_dst = "$Env:ProgramFiles\PowerShell\Modules\$module_name"
New-Item -ItemType Directory "$module_dst" -ErrorAction Ignore | Out-Null
Copy-Item -Recurse -Force ./src/* $module_dst -Verbose
Get-InstalledModule | Select-Object Name, Version, InstalledLocation
choco install vt-cli chocolatey-community-validation.extension -y
shell: pwsh
working-directory: chocolatey-au
- uses: actions/checkout@v4
with:
path: "packages"
- name: Configure Git
run: |
git config user.email "david@gardiner.net.au"
git config user.name "David Gardiner"
working-directory: packages
- name: Run
run: |
dotnet run
working-directory: autoupdate/AutoUpdate
env:
PACKAGES_REPO: "${{ github.workspace }}\\packages"
github_api_key: ${{ secrets.GH_API_KEY }} # GitHub API Key
api_key: ${{ secrets.API_KEY }} # Chocolatey API Key
VT_APIKEY: ${{ secrets.VT_APIKEY }} # VirusTotal API Key
- name: Status
run: |
git status
git push
git push -q --tags
git log --max-count 2 --pretty=medium
Get-ChildItem -Recurse *.nupkg | Select-Object -ExpandProperty FullName
working-directory: packages