From 8f269d6ee9c0cca9125991e58dfd5693857e1771 Mon Sep 17 00:00:00 2001 From: Michael Kelley Date: Sun, 21 Aug 2022 22:18:39 -0700 Subject: [PATCH] Add Deploy workflow (#6) * Add Deploy workflow - Add Deploy workflow - Doc cleanup in CI.yml * Fix workflow name --- .github/workflows/CI.yml | 13 ++----------- .github/workflows/Deploy.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/Deploy.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3bc0a6c..cbcbebf 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,28 +1,20 @@ -# This is a basic workflow to help you get started with Actions - name: CI # Controls when the workflow will run on: # Triggers the workflow on push or pull request events but only for the "master" branch push: - branches: [ "master" ] + branches: ["master"] pull_request: - branches: [ "master" ] + branches: ["master"] - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" build: - # The type of runner that the job will run on runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 - name: Install needed software @@ -31,4 +23,3 @@ jobs: - name: Build module run: ./build.ps1 shell: pwsh - diff --git a/.github/workflows/Deploy.yml b/.github/workflows/Deploy.yml new file mode 100644 index 0000000..c962008 --- /dev/null +++ b/.github/workflows/Deploy.yml @@ -0,0 +1,29 @@ +name: Deploy + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "master" branch + release: + types: [created] + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install needed software + run: ./.github/scripts/Install.ps1 + shell: pwsh + - name: Build Crescendo module + run: ./build.ps1 + shell: pwsh + - name: Publish PowerShell Module + run: ./.github/scripts/Deploy.ps1 + shell: pwsh + env: + POWERSHELLGALLERY_APIKEY: ${{ secrets.POWERSHELLGALLERY_APIKEY }} + GITHUB_PRERELEASE: ${{ github.event.release.prerelease }}