Skip to content

Fix broken publishing #24

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 2 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
32 changes: 32 additions & 0 deletions .github/prerelease-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name-template: '$NEXT_PATCH_VERSION-alpha'
tag-template: '$NEXT_PATCH_VERSION-alpha'
prerelease: true
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
## Changes

$CHANGES
31 changes: 31 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name-template: '$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
## Changes

$CHANGES
66 changes: 0 additions & 66 deletions .github/workflows/MainBuild.yml

This file was deleted.

81 changes: 81 additions & 0 deletions .github/workflows/Prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Prerelease Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- main

permissions:
contents: read

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- 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
- uses: release-drafter/release-drafter@v5
id: create_release
with:
config-name: prerelease-drafter.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Package ALZ Module
shell: pwsh
run: |
$tag_version = "${{ steps.create_release.outputs.tag_name }}".Replace("-alpha", "")
./package_ALZ.ps1 -version $tag_version -prerelease alpha
- uses: montudor/action-zip@v1
with:
args: zip -qq -r ALZ.zip ALZ
- uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ALZ.zip
asset_name: ALZ.zip
asset_content_type: application/zip
- uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}
- name: Publish ALZ Module
shell: pwsh
run: |
Publish-Module -Path "./ALZ" -NuGetApiKey ${{ secrets.POWERSHELL_GALLERY_KEY }}
27 changes: 1 addition & 26 deletions .github/workflows/PullRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@ jobs:
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}
Expand All @@ -47,17 +35,4 @@ jobs:
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
if-no-files-found: warn
77 changes: 77 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Prerelease Drafter

on:
workflow_dispatch:

permissions:
contents: read

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- 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
- uses: release-drafter/release-drafter@v5
id: create_release
with:
config-name: prerelease-drafter.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Package ALZ Module
shell: pwsh
run: |
./package_ALZ.ps1 -version ${{ steps.create_release.outputs.tag_name }}
- uses: montudor/action-zip@v1
with:
args: zip -qq -r ALZ.zip ALZ
- uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ALZ.zip
asset_name: ALZ.zip
asset_content_type: application/zip
- uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}
- name: Publish ALZ Module
shell: pwsh
run: |
Publish-Module -Path "./ALZ" -NuGetApiKey ${{ secrets.POWERSHELL_GALLERY_KEY }}
8 changes: 0 additions & 8 deletions GitVersion.yml

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# ALZ

[![ActionsTest-Windows-pwsh-Build](https://github.com/Azure/ALZ-PowerShell-Module/actions/workflows/wf_Windows_Core.yml/badge.svg?branch=main)](https://github.com/Azure/ALZ-PowerShell-Module/actions/workflows/wf_Windows_Core.yml)
[![license](https://img.shields.io/badge/License-MIT-purple.svg)](LICENSE)

![Logo](./docs/ALZLogo.png)
Expand Down
1 change: 1 addition & 0 deletions package_ALZ.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ 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