From 06835f71983ef3576b4408df4ddf25bf05e8ceb9 Mon Sep 17 00:00:00 2001 From: Michael Jolley Date: Mon, 5 Feb 2024 17:26:08 -0600 Subject: [PATCH] Working on CI/CD process --- .github/workflows/CI.yml | 15 +++++++-------- _build/build.ps1 | 3 ++- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5603921..0091a9a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -28,6 +28,8 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/main' # needs: test runs-on: ubuntu-latest + env: + PS_GALLERY_API_KEY: ${{ secrets.PS_GALLERY_API_KEY }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -35,11 +37,8 @@ jobs: - name: Build & publish module shell: pwsh run: ./_build/build.ps1 - - - name: Deploy to PS Gallery - uses: natescherer/publish-powershell-action@v1 - with: - token: ${{ secrets.PS_GALLERY_API_KEY }} - target: gallery - path: dist - \ No newline at end of file + + - name: Build & publish module + shell: pwsh + run: Publish-Module -Path /dist -NuGetApiKey $env:PS_GALLERY_API_KEY + \ No newline at end of file diff --git a/_build/build.ps1 b/_build/build.ps1 index c1ebca8..ccb0b54 100644 --- a/_build/build.ps1 +++ b/_build/build.ps1 @@ -5,4 +5,5 @@ if (Test-Path $dst) { Remove-Item -Path $dst -Recurse -Force } Get-ChildItem -Path $src -Exclude *.Tests.ps1 -Recurse | Where-Object FullName -NotLike "*mocks*" | ForEach-Object { $destination = $_.FullName -replace "\\src", "\dist" Copy-Item -Path $_.FullName -Destination $destination -Force -} \ No newline at end of file +} +Write-Line "Build complete." \ No newline at end of file