-
Notifications
You must be signed in to change notification settings - Fork 39
43 lines (41 loc) · 1.71 KB
/
Release.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
name: Publish PowerShell Module
on:
release:
types: [published]
jobs:
publish-to-gallery:
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- name: Set PSRepository to Trusted for PowerShell Gallery
shell: pwsh
run: |
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
- name: Install AsBuiltReport.Core module
shell: pwsh
run: |
Install-Module -Name AsBuiltReport.Core -Repository PSGallery -Force
- name: Test Module Manifest
shell: pwsh
run: |
Test-ModuleManifest .\AsBuiltReport.VMware.vSphere.psd1
- name: Publish module to PowerShell Gallery
shell: pwsh
run: |
Publish-Module -Path ./ -NuGetApiKey ${{ secrets.PSGALLERY_API_KEY }} -Verbose
tweet:
needs: publish-to-gallery
runs-on: ubuntu-latest
steps:
- uses: Eomm/why-don-t-you-tweet@v1
# We don't want to tweet if the repository is not a public one
if: ${{ !github.event.repository.private }}
with:
# GitHub event payload
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release
tweet-message: "[New Release] ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}! Check out what's new! ${{ github.event.release.html_url }} #VMware #vSphere #AsBuiltReport #vExpert"
env:
TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }}
TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }}
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}