-
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (48 loc) · 1.71 KB
/
Copy pathrelease.yml
File metadata and controls
55 lines (48 loc) · 1.71 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
name: Release to PowerShell Gallery
on:
push:
branches:
- main
paths:
- 'GUIDv7/GUIDv7.psd1'
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install newest stable version of PowerShell
shell: bash
run: |
# Update the list of packages
sudo apt-get update
# Install pre-requisite packages.
sudo apt-get install -y wget apt-transport-https software-properties-common
# Get the version of Ubuntu
source /etc/os-release
# Download the Microsoft repository keys
wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb
# Register the Microsoft repository keys
sudo dpkg -i packages-microsoft-prod.deb
# Delete the Microsoft repository keys file
rm packages-microsoft-prod.deb
# Update the list of packages after we added packages.microsoft.com
sudo apt-get update
###################################
# Install PowerShell
sudo apt-get install -y powershell
- name: Run Build-Module.ps1 script
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
./.github/Build-Module.ps1
- name: Re-Register PowerShell Gallery as Repository
shell: pwsh
run: |
Unregister-PSResourceRepository -Name PSGallery
Register-PSResourceRepository -PSGallery
- name: Publish to PowerShell Gallery
shell: pwsh
run: |
Publish-PSResource -Path ./GUIDv7 -Repository PSGallery -APIKey ${{ secrets.GALLERY_API_KEY }}