Merge pull request #39 from steviecoaster/develop #94
This file contains hidden or 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: Build NexuShell | |
| on: | |
| push: | |
| branches-ignore: | |
| - gh-pages | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| env: | |
| NugetApiKey: ${{ secrets.NugetApiKey }} | |
| ChocoApiKey: ${{ secrets.ChocoApiKey }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Required for GitVersion to behave | |
| - name: GitVersion | |
| id: gitversion | |
| uses: PoshCode/Actions/[email protected] | |
| - name: Install-RequiredModules | |
| uses: PoshCode/Actions/install-requiredmodules@v1 | |
| - name: Build Module | |
| run: .\build.ps1 -Build -SemVer "${{ steps.gitversion.outputs.SemVer }}" | |
| shell: pwsh | |
| - name: Upload Built Module | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: NexuShell.${{ steps.gitversion.outputs.SemVer }} | |
| path: .\Output | |
| - name: Test Module | |
| run: .\build.ps1 -TestPrePublish -SemVer "${{ steps.gitversion.outputs.SemVer }}" | |
| shell: pwsh | |
| - name: Upload Test Results | |
| uses: EnricoMi/publish-unit-test-result-action/composite@v1 | |
| if: always() | |
| with: | |
| files: TestResults.xml | |
| - name: Create Release | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| continue-on-error: true | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| release_name: NexuShell v${{ steps.gitversion.outputs.MajorMinorPatch }} | |
| tag_name: ${{ steps.gitversion.outputs.MajorMinorPatch }} | |
| body: | | |
| PowerShellGallery: [NexuShell ](https://www.powershellgallery.com/packages/NexuShell/${{ steps.gitversion.outputs.MajorMinorPatch }}) | |
| Chocolatey Community Repository: [NexuShell ](https://community.chocolatey.org/packages/NexuShell/${{ steps.gitversion.outputs.MajorMinorPatch }}) | |
| draft: false | |
| prerelease: ${{ github.ref != 'refs/heads/main' }} | |
| - name: Publish Module | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| run: .\build.ps1 -DeployToGallery -SemVer "${{ steps.gitversion.outputs.SemVer }}" |