|
1 | 1 | name: Publish PowerShell Module |
2 | 2 |
|
3 | 3 | on: |
4 | | - release: |
5 | | - types: [published] |
| 4 | + release: |
| 5 | + types: [published] |
6 | 6 |
|
7 | 7 | jobs: |
8 | | - publish-to-gallery: |
9 | | - runs-on: windows-latest |
10 | | - steps: |
11 | | - - uses: actions/checkout@v5 |
12 | | - - name: Set PSRepository to Trusted for PowerShell Gallery |
13 | | - shell: pwsh |
14 | | - run: | |
15 | | - Set-PSRepository -Name PSGallery -InstallationPolicy Trusted |
16 | | - - name: Install AsBuiltReport.Core module |
17 | | - shell: pwsh |
18 | | - run: | |
19 | | - Install-Module -Name AsBuiltReport.Core -Repository PSGallery -AllowPrerelease -Force |
20 | | - - name: Test Module Manifest |
21 | | - shell: pwsh |
22 | | - run: | |
23 | | - Test-ModuleManifest .\AsBuiltReport.System.Resources.psd1 |
24 | | - - name: Publish module to PowerShell Gallery |
25 | | - shell: pwsh |
26 | | - run: | |
27 | | - Publish-Module -Path ./ -NuGetApiKey ${{ secrets.PSGALLERY_API_KEY }} -Verbose |
28 | | - tweet: |
29 | | - needs: publish-to-gallery |
30 | | - runs-on: ubuntu-latest |
31 | | - steps: |
32 | | - - uses: Eomm/why-don-t-you-tweet@v2 |
33 | | - # We don't want to tweet if the repository is not a public one |
34 | | - if: ${{ !github.event.repository.private }} |
35 | | - with: |
36 | | - # GitHub event payload |
37 | | - # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release |
38 | | - tweet-message: "[New Release] ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}! Check out what's new! ${{ github.event.release.html_url }} #System #Resources #AsBuiltReport #PowerShell" |
39 | | - env: |
40 | | - TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }} |
41 | | - TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} |
42 | | - TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} |
43 | | - TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} |
44 | | - bsky-post: |
45 | | - needs: publish-to-gallery |
46 | | - runs-on: ubuntu-latest |
47 | | - steps: |
48 | | - - uses: zentered/[email protected] |
49 | | - with: |
50 | | - post: "[New Release] ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}! Check out what's new! ${{ github.event.release.html_url }} #System #Resources #AsBuiltReport #PowerShell" |
51 | | - env: |
52 | | - BSKY_IDENTIFIER: ${{ secrets.BSKY_IDENTIFIER }} |
53 | | - BSKY_PASSWORD: ${{ secrets.BSKY_PASSWORD }} |
| 8 | + publish-to-gallery: |
| 9 | + runs-on: windows-latest |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v5 |
| 12 | + - name: Set PSRepository to Trusted for PowerShell Gallery |
| 13 | + shell: pwsh |
| 14 | + run: | |
| 15 | + Set-PSRepository -Name PSGallery -InstallationPolicy Trusted |
| 16 | + - name: Install AsBuiltReport.Core module |
| 17 | + shell: pwsh |
| 18 | + run: | |
| 19 | + Install-Module -Name AsBuiltReport.Core -Repository PSGallery -Force |
| 20 | + - name: Test Module Manifest |
| 21 | + shell: pwsh |
| 22 | + run: | |
| 23 | + Test-ModuleManifest .\AsBuiltReport.System.Resources.psd1 |
| 24 | + - name: Publish module to PowerShell Gallery |
| 25 | + shell: pwsh |
| 26 | + run: | |
| 27 | + Publish-Module -Path ./ -NuGetApiKey ${{ secrets.PSGALLERY_API_KEY }} -Verbose |
| 28 | + tweet: |
| 29 | + needs: publish-to-gallery |
| 30 | + runs-on: ubuntu-latest |
| 31 | + steps: |
| 32 | + - uses: Eomm/why-don-t-you-tweet@v2 |
| 33 | + # We don't want to tweet if the repository is not a public one |
| 34 | + if: ${{ !github.event.repository.private }} |
| 35 | + with: |
| 36 | + # GitHub event payload |
| 37 | + # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release |
| 38 | + tweet-message: "[New Release] ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}! Check out what's new! ${{ github.event.release.html_url }} #System #Resources #AsBuiltReport #PowerShell" |
| 39 | + env: |
| 40 | + TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }} |
| 41 | + TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} |
| 42 | + TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} |
| 43 | + TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} |
| 44 | + bsky-post: |
| 45 | + needs: publish-to-gallery |
| 46 | + runs-on: ubuntu-latest |
| 47 | + steps: |
| 48 | + - uses: zentered/[email protected] |
| 49 | + with: |
| 50 | + post: "[New Release] ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}! Check out what's new! ${{ github.event.release.html_url }} #System #Resources #AsBuiltReport #PowerShell" |
| 51 | + env: |
| 52 | + BSKY_IDENTIFIER: ${{ secrets.BSKY_IDENTIFIER }} |
| 53 | + BSKY_PASSWORD: ${{ secrets.BSKY_PASSWORD }} |
0 commit comments