mdlopresti CI push #9
Workflow file for this run
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: CI | |
run-name: ${{ github.actor }} CI ${{ github.event_name }} | |
on: | |
push: | |
pull_request: | |
branches: [main] | |
env: | |
SHELL: powershell | |
jobs: | |
validate: | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: ${{ env.SHELL }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Environment | |
uses: "./.github/template/setup" | |
with: | |
shell: ${{ env.SHELL }} | |
- name: Generate Module Manifest | |
run: Invoke-Build generate_manifest | |
- name: Set Version | |
id: version | |
run: | | |
pwd | |
ls | |
$versionNumber = (Import-PowerShellDataFile .\src\ValidateJson\ValidateJson.psd1)["ModuleVersion"] | |
echo "version_number=$versionNumber" >> $GITHUB_OUTPUT | |
- name: Validate | |
run: Invoke-Build validate | |
- name: Generate Package | |
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' | |
run: | | |
Invoke-Build clean | |
Invoke-Build generate_package -zipPackage $true | |
- name: Save Package | |
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: package | |
path: dist/ValidateJson.zip | |
retention-days: 7 | |
- name: Create Release | |
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} ${{ steps.version.outputs.version_number }} | |
prerelease: ${{ github.ref != 'refs/heads/main' }} |