Skip to content

Commit

Permalink
Merge pull request #60 from Zhaopudark/dev
Browse files Browse the repository at this point in the history
Prepare for publish
  • Loading branch information
Zhaopudark authored Jan 19, 2024
2 parents bce72de + cc0a106 commit 8eb81aa
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 38 deletions.
3 changes: 2 additions & 1 deletion Module/PSComputerManagementZp.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ $ModuleInfo = @{
# Module Settings For PSD1
$ModuleSettings = @{
RootModule = "$($ModuleInfo.ModuleName).psm1"
CompatiblePSEditions = @('Desktop', 'Core')
ModuleVersion = '0.0.7'
Prerelease = 'b0'
Prerelease = 'b1'
Author = 'Pu Zhao'
Description = 'A PowerShell module that derives from personal scenarios, can help users configure the Windows PCs easily to realize many useful operations, involving authorization, env, links, proxy, etc. Some features are also available on WSL2, Linux, and MacOS. See [PSComputerManagementZp](https://github.com/Zhaopudark/PSComputerManagementZp) for more details.'
PowerShellVersion = '7.0'
Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
# PSComputerManagementZp

[![PowerShell-7.X](https://img.shields.io/badge/PowerShell-7.X-blue?logo=powershell)](https://learn.microsoft.com/en-us/powershell/)
[![GitHub release (with filter)](https://img.shields.io/github/v/release/Zhaopudark/PSComputermanagementZp?logo=github)](https://github.com/Zhaopudark/PSComputerManagementZp/releases)
[![GitHub tag (with filter)](https://img.shields.io/github/v/tag/Zhaopudark/PSComputerManagementZp?logo=github)](https://github.com/Zhaopudark/PSComputerManagementZp/tags)
[![PowerShell Gallery Downloads](https://img.shields.io/powershellgallery/dt/PSComputerManagementZp?logo=powershell&label=PowerShell%20Gallery%20downloads)](https://www.powershellgallery.com/packages/PSComputerManagementZp)
[![GitHub Release Downloads](https://img.shields.io/github/downloads/Zhaopudark/PSComputerManagementZp/total?logo=github&label=Github%20Release%20downloads)
](https://github.com/Zhaopudark/PSComputerManagementZp/releases)
[![PowerShell Gallery Version](https://img.shields.io/powershellgallery/v/PSComputermanagementZp?include_prereleases&logo=powershell)](https://github.com/Zhaopudark/PSComputerManagementZp/releases)
[![PowerShell Gallery Downloads](https://img.shields.io/powershellgallery/dt/PSComputerManagementZp?logo=powershell)](https://www.powershellgallery.com/packages/PSComputerManagementZp)
[![GitHub](https://img.shields.io/github/license/Zhaopudark/PSComputerManagementZp)](https://github.com/Zhaopudark/PSComputerManagementZp/blob/main/LICENSE)
[![codecov](https://codecov.io/gh/Zhaopudark/PSComputerManagementZp/graph/badge.svg?token=6C2LZE0W5I)](https://codecov.io/gh/Zhaopudark/PSComputerManagementZp)

[![codecov](https://codecov.io/gh/Zhaopudark/PSComputerManagementZp/graph/badge.svg?token=6C2LZE0W5I)](https://codecov.io/gh/Zhaopudark/PSComputerManagementZp)
[![Home](https://img.shields.io/badge/Home-Home-blue)](README.md)
[![Public-Examples](https://img.shields.io/badge/Public-Examples-royalblue)](Examples/README.md)
[![Public-AIPs](https://img.shields.io/badge/Public-AIPs-orange)](Docs/APIs/README.md)
Expand Down
5 changes: 5 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# PSComputerManagementZp 0.0.7

## Release 0.0.7b1
- Prepare for a formal release.
- Prepare for sync to Zenodo.

## Release 0.0.7b0
- Fix some building bugs of this module.

Expand Down
8 changes: 1 addition & 7 deletions Scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ $ConfigInfo= @{
Import-Module "${root_path}\Module\PSComputerManagementZp.psm1" -Force -Scope Local

# check release version
$release_version = $ModuleSettings.ModuleVersion+$ModuleSettings.Prerelease
python "${root_path}/Scripts/check_release_version.py" $release_version (Get-Item $ConfigInfo.MDDocs.Release).FullName
if ($LastExitCode -ne 0){
# Write-Host $checking_info
throw "The release version in $($ConfigInfo.MDDocs.Release) is not consistent with the given version in ${root_path}\Module\PSComputerManagementZp.psm1."
}

$release_version = . "${PSScriptRoot}\check_release_version.ps1"

# generate APIs README.md
$api_content = @("All ``public APIs`` are recorded here.")
Expand Down
13 changes: 13 additions & 0 deletions Scripts/check_release_version.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This script file is for local machine only, without considering any configuration or installation.
$ErrorActionPreference = 'Stop'
$root_path = (Get-Item "${PSScriptRoot}/..").FullName
Import-Module "${root_path}/Module/PSComputerManagementZp.psm1" -Force -Scope Local
$release_note_path = "${root_path}/RELEASE.md"

# check release version
$release_version = $ModuleSettings.ModuleVersion+$ModuleSettings.Prerelease
python "${PSScriptRoot}/check_release_version.py" $release_version $release_note_path
if ($LastExitCode -ne 0){
throw "The release version in $release_note_path is not consistent with the given version in ${root_path}/Module/PSComputerManagementZp.psm1."
}
return $release_version
14 changes: 0 additions & 14 deletions Scripts/commit_and_push.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,6 @@ if ($currentBranch -eq "main") {
git add . # 添加需要提交的文件(假设你要提交所有文件)
git commit -m $message
git push origin dev:dev
# 如果当前分支是 dev 分支,则进行 commit 操作
# . "${PSScriptRoot}/check_release_version.ps1"


# if (git branch --list dev) {
# # 如果分支存在,则切换到 dev 分支
# git switch dev
# } else {
# # 如果分支不存在,则创建一个新的 dev 分支并切换到该分支
# git switch -c dev
# }

# # 获取当前所在的分支
#
} else {
Write-Host "Not on main branch. Current branch: $currentBranch"
}
10 changes: 0 additions & 10 deletions Scripts/delete_dev.ps1

This file was deleted.

24 changes: 24 additions & 0 deletions Scripts/tag_and_push.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

$version = . "${PSScriptRoot}/check_release_version.ps1"
$tagName = "v${version}"

# 检测标签是否存在
if (git show-ref "refs/tags/$tagName") {
Write-Error "Tag '$tagName' already exists."
} else {
# 标签不存在
Write-Output "Tag '$tagName' does not exist."
Write-Output "Creating tag '$tagName'."
git tag -a $tagName -m "Release $tagName"
}

# 检测远程标签是否存在
if (git ls-remote --tags origin | Where-Object { $_ -match "refs/tags/$tagName" }) {
Write-Error "Remote tag '$tagName' already exists."
} else {
# 远程标签不存在
Write-Output "Remote tag '$tagName' does not exist."
Write-Output "Pushing tag '$tagName' to remote."
git push origin $tagName
}

0 comments on commit 8eb81aa

Please sign in to comment.