we wont create change release branch (#70) #3
Workflow file for this run
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
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- CHANGELOG.md | |
- .vscode/** | |
- .github/** | |
- images/** | |
- tests/** | |
- '**.md' | |
- '**.yml' | |
tags: | |
- '**' | |
- '!*preview*' | |
env: | |
buildFolderName: output | |
buildArtifactName: output | |
name: Deploy Module | |
# This workflow is triggered on push to the main branch and deploys the module to the PowerShell Gallery and creates a GitHub Release. | |
jobs: | |
Build_Stage_Package_Module: | |
name: Package Module | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} # checkout the correct branch name | |
fetch-depth: 0 | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: 5.x | |
- name: Evaluate Next Version | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
configFilePath: GitVersion.yml | |
- name: Build & Package Module | |
shell: pwsh | |
run: ./build.ps1 -ResolveDependency -tasks pack | |
env: | |
ModuleVersion: ${{ env.gitVersion.MajorMinorPatch }} | |
- name: Publish Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.buildArtifactName }} | |
path: ${{ env.buildFolderName }}/ | |
Deploy_Stage_Deploy_Module: | |
name: Deploy Module | |
runs-on: ubuntu-latest | |
needs: | |
- Build_Stage_Package_Module | |
if: ${{ success() && (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/')) }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} # checkout the correct branch name | |
fetch-depth: 0 | |
- name: Download Build Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.buildArtifactName }} | |
path: ${{ env.buildFolderName }} | |
- name: Publish Release | |
shell: pwsh | |
run: ./build.ps1 -tasks publish | |
env: | |
GitHubToken: ${{ secrets.GitHubToken }} | |
GalleryApiToken: ${{ secrets.GalleryApiToken }} | |
- name: Send Changelog PR | |
shell: pwsh | |
run: ./build.ps1 -tasks Create_ChangeLog_GitHub_PR | |
env: | |
GitHubToken: ${{ secrets.GitHubToken }} | |
GalleryApiToken: ${{ secrets.GalleryApiToken }} | |
ReleaseBranch: main | |
MainGitBranch: main |