Skip to content

Adding publish pipeline #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
baeab35
Trying this out
lovelysandwich Mar 28, 2023
b77c399
Adding GitVersion to pipeline
lovelysandwich Mar 28, 2023
7f5f9e6
Run on Linux
lovelysandwich Mar 28, 2023
6a2933e
Need .NET if running on Ubuntu
lovelysandwich Mar 28, 2023
8283b74
Configuring version configuration
lovelysandwich Mar 28, 2023
4aedb33
Wrong config file
lovelysandwich Mar 28, 2023
f793377
Trying this out
lovelysandwich Mar 28, 2023
04de95b
Adding beta flag
lovelysandwich Mar 28, 2023
38f95c4
Remove action it doesn't work
lovelysandwich Mar 28, 2023
0723134
Remove action it doesn't work
lovelysandwich Mar 28, 2023
ede2fb8
Adding packaging step
lovelysandwich Mar 28, 2023
601f16c
Bumping version number
lovelysandwich Mar 28, 2023
ef963f6
Trying this Semver
lovelysandwich Mar 28, 2023
931dbf9
Changing the tag
lovelysandwich Mar 28, 2023
48be2fe
Trying this now
lovelysandwich Mar 28, 2023
eff326e
Trying this too
lovelysandwich Mar 28, 2023
903669a
Trying this now
lovelysandwich Mar 28, 2023
d2d7a5d
Adopting CR comments and tidy up
lovelysandwich Mar 29, 2023
84a15d0
Adding in functionality for main branch publishing
lovelysandwich Mar 29, 2023
e696d38
Trying to avoid publishing final module until we're ready
lovelysandwich Mar 29, 2023
e04bf32
Trying to avoid publishing final module until we're ready
lovelysandwich Mar 29, 2023
c31c6b9
Merge branch 'adding_publish_pipeline' of https://github.com/Azure/AL…
lovelysandwich Mar 29, 2023
59deb83
Merge branch 'adding_publish_pipeline' of https://github.com/Azure/AL…
lovelysandwich Mar 29, 2023
23490df
Merge branch 'adding_publish_pipeline' of https://github.com/Azure/AL…
lovelysandwich Mar 29, 2023
f4e6866
Allow Force on non-main branch publishes
lovelysandwich Mar 29, 2023
806cad2
Tidying up actions
lovelysandwich Mar 29, 2023
a0351ae
Merge branch 'main' into adding_publish_pipeline
lovelysandwich Mar 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/MainBuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Release-Build
on:
push:
branches:
- main
paths-ignore:
- '**.md'
- 'docs/**'
jobs:
test:
name: Build, Test & Publish
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pwsh: [ '7.1.3' ]
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '3.1.x'
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.5.0'
- name: Determine Version
id: gitversion # id to later be referenced
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
- name: Display the path
shell: pwsh
run: echo ${env:PATH}
- name: Version Display
shell: pwsh
run: $PSVersionTable
- name: Bootstrap
shell: pwsh
run: ./actions_bootstrap.ps1
- name: Test and Build
shell: pwsh
run: Invoke-Build -File .\src\ALZ.build.ps1
- name: Upload pester results
uses: actions/upload-artifact@v3
with:
name: pester-results
path: .\src\Artifacts\testOutput
if-no-files-found: warn
- name: Upload zip module archive build
uses: actions/upload-artifact@v3
with:
name: zip-archive
path: .\src\Archive
if-no-files-found: warn
- name: Package ALZ Module
shell: pwsh
# hardcode this as beta until we're ready to take this live
run: ./package_ALZ.ps1 -version ${{ steps.gitversion.outputs.majorMinorPatch }} -prerelease beta
- name: Publish ALZ Module
shell: pwsh
run: |
Publish-Module -Path "./ALZ" -NuGetApiKey ${{ secrets.POWERSHELL_GALLERY_KEY }}

63 changes: 63 additions & 0 deletions .github/workflows/PullRequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Branch-Build
on:
pull_request:
paths-ignore:
- '**.md'
- 'docs/**'

jobs:
test:
name: Build & Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pwsh: [ '7.1.3' ]
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '3.1.x'
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.5.0'
- name: Determine Version
id: gitversion # id to later be referenced
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
- name: Display the path
shell: pwsh
run: echo ${env:PATH}
- name: Version Display
shell: pwsh
run: $PSVersionTable
- name: Bootstrap
shell: pwsh
run: ./actions_bootstrap.ps1
- name: Test and Build
shell: pwsh
run: Invoke-Build -File .\src\ALZ.build.ps1
- name: Upload pester results
uses: actions/upload-artifact@v3
with:
name: pester-results
path: .\src\Artifacts\testOutput
if-no-files-found: warn
- name: Upload zip module archive build
uses: actions/upload-artifact@v3
with:
name: zip-archive
path: .\src\Archive
if-no-files-found: warn
- name: Package ALZ Module
shell: pwsh
run: ./package_ALZ.ps1 -version ${{ steps.gitversion.outputs.majorMinorPatch }} -prerelease ${{ steps.gitversion.outputs.nuGetPreReleaseTagV2 }}
- name: Publish ALZ Module
shell: pwsh
run: |
Publish-Module -Path "./ALZ" -NuGetApiKey ${{ secrets.POWERSHELL_GALLERY_KEY }} -Force
57 changes: 0 additions & 57 deletions .github/workflows/wf_Windows_Core.yml

This file was deleted.

8 changes: 8 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
mode: ContinuousDeployment
branches:
feature:
regex: ^(?!^main$).*$
tag: alpha
increment: Inherit
is-release-branch: false
is-mainline: false
9 changes: 9 additions & 0 deletions package_ALZ.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
param(
[string]$version,
[string]$prerelease = ""
)

New-Item "ALZ" -ItemType Directory -Force
Copy-Item -Path "./src/Artifacts/*" -Destination "./ALZ" -Recurse -Exclude "ccReport", "testOutput" -Force

Update-ModuleManifest -Path "./ALZ/ALZ.psd1" -ModuleVersion $version -Prerelease $prerelease
6 changes: 2 additions & 4 deletions src/ALZ/ALZ.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
IconUri = 'https://raw.githubusercontent.com/Azure/ALZ-PowerShell-Module/main/docs/rsz_alzlogo.png?token=GHSAT0AAAAAACAOIZ6NBDR7MPRSCNBS3RQUZA4IYUQ'

# ReleaseNotes of this module
ReleaseNotes = 'Thsi is the first release of the ALZ PowerShell Module. This module is currently in preview and is subject to change.'
ReleaseNotes = 'This is the first release of the ALZ PowerShell Module. This module is currently in preview and is subject to change.'

# Prerelease string of this module
Prerelease = 'beta'
Expand All @@ -125,9 +125,7 @@
# RequireLicenseAcceptance = $false

# External dependent modules of this module
ExternalModuleDependencies = @(
'Az.Resources'
)
ExternalModuleDependencies = @()

} # End of PSData hashtable

Expand Down