-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from theohbrothers/refactor/add-github-workflows
Refactor: Add github workflows
- Loading branch information
Showing
3 changed files
with
351 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name-template: 'v$RESOLVED_VERSION 🌈' | ||
tag-template: 'v$RESOLVED_VERSION' | ||
categories: | ||
- title: '🚀 Features' | ||
labels: | ||
- 'feature' | ||
- 'enhancement' | ||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- 'fix' | ||
- 'bugfix' | ||
- 'bug' | ||
- title: '🖊️ Refactors' | ||
labels: | ||
- 'refactor' | ||
- title: '👗 Style' | ||
labels: | ||
- 'style' | ||
- title: '📝 Documentation' | ||
labels: | ||
- 'docs' | ||
- 'documentation' | ||
- title: '🧰 Maintenance' | ||
label: 'chore' | ||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)' | ||
version-resolver: | ||
major: | ||
labels: | ||
# - 'major' | ||
- 'breaking' | ||
minor: | ||
labels: | ||
# - 'minor' | ||
- 'feature' | ||
- 'enhancement' | ||
- 'refactor' | ||
patch: | ||
labels: | ||
# - 'patch' | ||
- 'fix' | ||
- 'bugfix' | ||
- 'bug' | ||
- 'style' | ||
- 'docs' | ||
- 'documentation' | ||
- 'chore' | ||
default: patch | ||
sort-by: title | ||
template: | | ||
## Changes | ||
$CHANGES |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,294 @@ | ||
name: ci-master-pr | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test-powershell-5-1-windows-2016: | ||
runs-on: windows-2016 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Display system info (windows) | ||
run: | | ||
Set-StrictMode -Version Latest; $ErrorActionPreference = 'Stop' | ||
hostname | ||
whoami | ||
systeminfo | ||
Get-PSDrive | ||
Get-Location | ||
# pwsh version | ||
$PSVersionTable | ||
# Windows Powershell version? | ||
powershell -Command '$PSVersionTable' | ||
- name: Powershell version | ||
run: | | ||
powershell -NoLogo -NonInteractive -NoProfile -Command '$PSVersionTable' | ||
- name: Test | ||
run: | | ||
powershell -NoLogo -NonInteractive -NoProfile -Command './test/test.ps1' | ||
test-powershell-5-1-windows-2019: | ||
runs-on: windows-2019 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Display system info (windows) | ||
run: | | ||
Set-StrictMode -Version Latest; $ErrorActionPreference = 'Stop' | ||
hostname | ||
whoami | ||
systeminfo | ||
Get-PSDrive | ||
Get-Location | ||
# pwsh version | ||
$PSVersionTable | ||
# Windows Powershell version? | ||
powershell -Command '$PSVersionTable' | ||
- name: Powershell version | ||
run: | | ||
powershell -NoLogo -NonInteractive -NoProfile -Command '$PSVersionTable' | ||
- name: Test | ||
run: | | ||
powershell -NoLogo -NonInteractive -NoProfile -Command './test/test.ps1' | ||
# ubuntu-16-04: | ||
# runs-on: ubuntu-16.04 | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - name: Display system info (linux) | ||
# run: | | ||
# set -e | ||
# hostname | ||
# whoami | ||
# cat /etc/*release | ||
# lscpu | ||
# free | ||
# df -h | ||
# pwd | ||
# docker info | ||
# docker version | ||
|
||
# macos-10-15: | ||
# runs-on: macos-10.15 | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - name: Display system info (macos) | ||
# run: | | ||
# set -e | ||
# hostname | ||
# whoami | ||
# df -h | ||
# pwd | ||
# # docker info | ||
# # docker version | ||
|
||
########## | ||
# Docker # | ||
########## | ||
test-powershell-6-0: | ||
runs-on: ubuntu-16.04 | ||
container: | ||
# image: theohbrothers/docker-powershell:6.0.2-ubuntu-16.04-git | ||
image: mcr.microsoft.com/powershell:6.0.2-ubuntu-16.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Display system info (linux) | ||
run: | | ||
set -e | ||
hostname | ||
whoami | ||
cat /etc/*release | ||
lscpu | ||
free | ||
df -h | ||
pwd | ||
- name: Powershell version | ||
run: | | ||
pwsh -NoLogo -NonInteractive -NoProfile -Command '$PSVersionTable' | ||
- name: Test | ||
run: | | ||
pwsh -NoLogo -NonInteractive -NoProfile -Command './test/test.ps1' | ||
test-powershell-6-1: | ||
runs-on: ubuntu-16.04 | ||
container: | ||
# image: theohbrothers/docker-powershell:6.1.3-alpine-3.8-git | ||
# image: mcr.microsoft.com/powershell:6.1.3-alpine-3.8 | ||
image: mcr.microsoft.com/powershell:6.1.3-ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Display system info (linux) | ||
run: | | ||
set -e | ||
hostname | ||
whoami | ||
cat /etc/*release | ||
# lscpu | ||
free | ||
df -h | ||
pwd | ||
- name: Powershell version | ||
run: | | ||
pwsh -NoLogo -NonInteractive -NoProfile -Command '$PSVersionTable' | ||
- name: Test | ||
run: | | ||
pwsh -NoLogo -NonInteractive -NoProfile -Command './test/test.ps1' | ||
test-powershell-6-2: | ||
runs-on: ubuntu-16.04 | ||
container: | ||
# image: theohbrothers/docker-powershell:6.2.4-alpine-3.8-git | ||
# image: mcr.microsoft.com/powershell:6.2.4-alpine-3.8 | ||
image: mcr.microsoft.com/powershell:6.2.4-ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Display system info (linux) | ||
run: | | ||
set -e | ||
hostname | ||
whoami | ||
cat /etc/*release | ||
# lscpu | ||
free | ||
df -h | ||
pwd | ||
- name: Powershell version | ||
run: | | ||
pwsh -NoLogo -NonInteractive -NoProfile -Command '$PSVersionTable' | ||
- name: Test | ||
run: | | ||
pwsh -NoLogo -NonInteractive -NoProfile -Command './test/test.ps1' | ||
test-powershell-7-0: | ||
runs-on: ubuntu-16.04 | ||
container: | ||
# image: theohbrothers/docker-powershell:7.0.3-alpine-3.9-20200928 | ||
# image: mcr.microsoft.com/powershell:7.0.3-alpine-3.9 | ||
image: mcr.microsoft.com/powershell:7.0.3-ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Display system info (linux) | ||
run: | | ||
set -e | ||
hostname | ||
whoami | ||
cat /etc/*release | ||
# lscpu | ||
free | ||
df -h | ||
pwd | ||
- name: Powershell version | ||
run: | | ||
pwsh -NoLogo -NonInteractive -NoProfile -Command '$PSVersionTable' | ||
- name: Test | ||
run: | | ||
pwsh -NoLogo -NonInteractive -NoProfile -Command './test/test.ps1' | ||
test-powershell-7-1: | ||
runs-on: ubuntu-16.04 | ||
container: | ||
# image: theohbrothers/docker-powershell:7.1.3-alpine-3.11-20210316-git | ||
# image: mcr.microsoft.com/powershell:7.1.3-alpine-3.11-20210316 | ||
image: mcr.microsoft.com/powershell:7.1.3-ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Display system info (linux) | ||
run: | | ||
set -e | ||
hostname | ||
whoami | ||
cat /etc/*release | ||
# lscpu | ||
free | ||
df -h | ||
pwd | ||
- name: Powershell version | ||
run: | | ||
pwsh -NoLogo -NonInteractive -NoProfile -Command '$PSVersionTable' | ||
- name: Test | ||
run: | | ||
pwsh -NoLogo -NonInteractive -NoProfile -Command './test/test.ps1' | ||
test-powershell-7-2: | ||
runs-on: ubuntu-16.04 | ||
container: | ||
# image: theohbrothers/docker-powershell:7.2.0-preview.4-alpine-3.11-20210316-git | ||
# image: mcr.microsoft.com/powershell:7.2.0-preview.4-alpine-3.11-20210316 | ||
image: mcr.microsoft.com/powershell:7.2.0-preview.4-ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Display system info (linux) | ||
run: | | ||
set -e | ||
hostname | ||
whoami | ||
cat /etc/*release | ||
# lscpu | ||
free | ||
df -h | ||
pwd | ||
- name: Powershell version | ||
run: | | ||
pwsh -NoLogo -NonInteractive -NoProfile -Command '$PSVersionTable' | ||
- name: Test | ||
run: | | ||
pwsh -NoLogo -NonInteractive -NoProfile -Command './test/test.ps1' | ||
update-draft-release: | ||
needs: [test-powershell-5-1-windows-2016, test-powershell-5-1-windows-2019, test-powershell-6-0, test-powershell-6-1, test-powershell-6-1, test-powershell-7-0, test-powershell-7-1, test-powershell-7-2] | ||
if: github.ref == 'refs/heads/master' | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Drafts your next Release notes as Pull Requests are merged into "master" | ||
- uses: release-drafter/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
publish-to-psgallery: | ||
needs: [test-powershell-5-1-windows-2016, test-powershell-5-1-windows-2019, test-powershell-6-0, test-powershell-6-1, test-powershell-6-1, test-powershell-7-0, test-powershell-7-1, test-powershell-7-2] | ||
if: startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- name: Powershell version | ||
run: | | ||
pwsh -NoLogo -NonInteractive -NoProfile -Command '$PSVersionTable' | ||
- name: Publish | ||
env: | ||
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | ||
run: | | ||
set -e | ||
# Get 'ref-name' from 'refs/heads/ref-name' | ||
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) | ||
# Strip of 'v' prefix from tag | ||
MODULE_VERSION=$( echo "${REF}" | sed 's/^v*//' ) | ||
# Generate the new module manifest | ||
MODULE_NAME=$(basename $(pwd)) | ||
MODULE_VERSION=${MODULE_VERSION} pwsh -Command "build/PSModulePublisher/src/module/Generate-ModuleManifest.ps1 -DefinitionFile build/definitions/modulemanifest/definition.ps1 -Path src/$MODULE_NAME/$MODULE_NAME.psd1" | ||
# Publish the module | ||
NUGET_API_KEY=${NUGET_API_KEY} MODULE_VERSION=${MODULE_VERSION} pwsh -Command "build/PSModulePublisher/src/Invoke-Publish.ps1 -ModuleManifestPath src/$MODULE_NAME/$MODULE_NAME.psd1 -Repository PSGallery" | ||
publish-draft-release: | ||
needs: [test-powershell-5-1-windows-2016, test-powershell-5-1-windows-2019, test-powershell-6-0, test-powershell-6-1, test-powershell-6-1, test-powershell-7-0, test-powershell-7-1, test-powershell-7-2, publish-to-psgallery] | ||
if: startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: release-drafter | ||
uses: release-drafter/release-drafter@v5 | ||
with: | ||
# config-name: release-drafter.yaml | ||
publish: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains 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