🚀 #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 🚀 | |
on: | |
workflow_dispatch: | |
jobs: | |
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-powershell | |
# https://github.com/kachick/PSFzfHistory/issues/12 | |
gallery: | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
shell: pwsh | |
outputs: | |
version: ${{ steps.meta.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Print current config | |
id: meta | |
run: | | |
Get-PSRepository | |
Write-Output "version=$((Import-PowerShellDataFile ./PSFzfHistory/PSFzfHistory.psd1).ModuleVersion)" | Tee-Object -Append -FilePath ${env:GITHUB_OUTPUT} | |
- name: Wait other jobs | |
uses: kachick/[email protected] | |
timeout-minutes: 30 | |
with: | |
skip-list: | | |
[ | |
{ | |
"workflowFile": "merge-bot-pr.yml" | |
} | |
] | |
- name: Publish | |
env: | |
NUGET_KEY: ${{ secrets.NUGET_API_KEY }} | |
run: | | |
Copy-Item -Path .\README.md, .\LICENSE -Destination .\PSFzfHistory | |
Publish-Module -Path .\PSFzfHistory -NuGetApiKey $env:NUGET_KEY -Repository PSGallery -Verbose | |
github: | |
needs: [gallery] | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
# https://pubs.opengroup.org/onlinepubs/009695399/utilities/set.html | |
shell: bash -Ceuxo pipefail {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Add tags | |
run: | | |
git tag 'v${{ needs.gallery.outputs.version }}' | |
git push origin --tags | |
- name: Create GitHub Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
# TODO: Upload zipped PSFzfHistory files as the assets | |
gh release create 'v${{ needs.gallery.outputs.version }}' --generate-notes |