Merge pull request #181 from dataplat/develop #4
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: | |
| - '*' | |
| env: | |
| buildFolderName: output | |
| buildArtifactName: output | |
| permissions: | |
| actions: write # to allow the workflow to run actions | |
| checks: write # to allow the workflow to create checks | |
| statuses: write # to allow the workflow to create statuses | |
| name: Deploy Module (only) | |
| # 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 triggered ref (branch or tag) | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build & Package Module | |
| shell: pwsh | |
| run: ./build.ps1 -ResolveDependency -tasks pack | |
| - 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/main' || startsWith(github.ref, 'refs/tags/')) }} | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: ${{ github.head_ref }} # checkout the triggered ref (branch or tag) | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - 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 }} |