From 6b4ad292a321704ef084569d3c7a954487e67760 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 21 Oct 2023 21:07:29 +0200 Subject: [PATCH] Update to template workflow --- .github/workflows/Module.GitHub.yml | 36 ------------ .github/workflows/Process-PSModule.yml | 13 +++++ .github/workflows/Test.GitHub.yml | 81 -------------------------- 3 files changed, 13 insertions(+), 117 deletions(-) delete mode 100644 .github/workflows/Module.GitHub.yml create mode 100644 .github/workflows/Process-PSModule.yml delete mode 100644 .github/workflows/Test.GitHub.yml diff --git a/.github/workflows/Module.GitHub.yml b/.github/workflows/Module.GitHub.yml deleted file mode 100644 index 9a67150b..00000000 --- a/.github/workflows/Module.GitHub.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Module [GitHub] - -on: - push: - branches: - - '*' - paths: - - .github/workflows/Module.GitHub.yml - - src/GitHub/** - workflow_dispatch: - -jobs: - BuildModule: - name: Build Module - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ github.token }} # Used for GitHub CLI authentication - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: Build Module - uses: PSModule/Build-Module@main - with: - Verbose: true - - - name: Test Module - uses: PSModule/Test-Module@main - with: - Verbose: true - - - name: Release Module - uses: PSModule/Release-Module@main - with: - APIKey: ${{ secrets.APIKEY }} - Verbose: true diff --git a/.github/workflows/Process-PSModule.yml b/.github/workflows/Process-PSModule.yml new file mode 100644 index 00000000..cb2eb1cc --- /dev/null +++ b/.github/workflows/Process-PSModule.yml @@ -0,0 +1,13 @@ +name: Process-PSModule + +on: + push: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }} + +jobs: + Process-PSModule: + uses: PSModule/Actions/.github/workflows/Process-PSModule.yml@main + secrets: inherit diff --git a/.github/workflows/Test.GitHub.yml b/.github/workflows/Test.GitHub.yml deleted file mode 100644 index a8826669..00000000 --- a/.github/workflows/Test.GitHub.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Test [GitHub] - -on: - workflow_dispatch: - -permissions: write-all - -jobs: - TestGitHub: - name: Test GitHub - if: always() - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - runs-on: ${{ matrix.os }} - env: - GH_TOKEN: ${{ github.token }} # Used for GitHub CLI authentication - steps: - - name: Test Authentication using auto PAT - if: always() - shell: pwsh - run: | - Write-Output '::group::[Debug info] - Environment variables' - $env:GITHUB_REPOSITORY_NAME = $env:GITHUB_REPOSITORY.Split('/')[1] - Get-ChildItem Env: - Write-Output '::endgroup::' - - Write-Output '::group::[Debug info] - File structure' - Write-Verbose "Current directory: $((Get-Location).Path)" -Verbose - Write-Verbose "------------------------------------" -Verbose - Write-Verbose "Current directory content:" -Verbose - Get-ChildItem -Path . -Recurse | Select-Object -ExpandProperty FullName | Sort-Object - Write-Output '::endgroup::' - - Write-Output '::group::Install-Module -Name GitHub -Verbose -Force' - Install-Module -Name GitHub -Verbose -Force - Write-Output '::endgroup::' - - Write-Output '::group::Get-GitHubConfig' - Get-GitHubConfig - Write-Output '::endgroup::' - - Write-Output '::group::Get-GitHubWorkflow -Repo $env:GITHUB_REPOSITORY_NAME -Owner $env:GITHUB_REPOSITORY_OWNER -Verbose' - Get-GitHubWorkflow -Repo $env:GITHUB_REPOSITORY_NAME -Owner $env:GITHUB_REPOSITORY_OWNER -Verbose - Write-Output '::endgroup::' - - - name: Test Authentication using Specific PAT - if: always() - shell: pwsh - run: | - Write-Output '::group::[Debug info] - Environment variables' - $env:GITHUB_REPOSITORY_NAME = $env:GITHUB_REPOSITORY.Split('/')[1] - Get-ChildItem Env: - Write-Output '::endgroup::' - - Write-Output '::group::[Debug info] - File structure' - Write-Verbose "Current directory: $((Get-Location).Path)" -Verbose - Write-Verbose "------------------------------------" -Verbose - Write-Verbose "Current directory content:" -Verbose - Get-ChildItem -Path . -Recurse | Select-Object -ExpandProperty FullName | Sort-Object - Write-Output '::endgroup::' - - Write-Output '::group::Install-Module -Name GitHub -Verbose -Force' - Install-Module -Name GitHub -Verbose -Force - Write-Output '::endgroup::' - - Write-Output '::group::Get-GitHubConfig' - Get-GitHubConfig - Write-Output '::endgroup::' - - Write-Output '::group::Connect-GitHubAccount -AccessToken $env:GH_TOKEN -Verbose' - Connect-GitHubAccount -AccessToken $env:GH_TOKEN -Verbose - Write-Output '::endgroup::' - - Write-Output '::group::Get-GitHubConfig' - Get-GitHubConfig - Write-Output '::endgroup::' - - Write-Output '::group::Get-GitHubWorkflow -Repo $env:GITHUB_REPOSITORY_NAME -Owner $env:GITHUB_REPOSITORY_OWNER -Verbose' - Get-GitHubWorkflow -Repo $env:GITHUB_REPOSITORY_NAME -Owner $env:GITHUB_REPOSITORY_OWNER -Verbose - Write-Output '::endgroup::'