Skip to content

Commit

Permalink
fix: made my own release script
Browse files Browse the repository at this point in the history
  • Loading branch information
ArwynFr committed Apr 30, 2023
1 parent e1001b3 commit 9abd109
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 deletions.
26 changes: 4 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,16 @@ jobs:
release:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3

- name: Get new version
id: new-version
uses: arwynfr/actions-conventional-versioning/get-newVersion@v1

- name: 'Copy templates'
shell: pwsh
run: Copy-Item src/.templates out/ArmaServer/.templates -Recurse -Force

- name: 'Copy manifest'
shell: pwsh
run: Copy-Item build/ArmaServer.psd1 out/ArmaServer/ArmaServer.psd1 -Force

- name: 'Make module file'
shell: pwsh
run: Get-ChildItem src -Filter '*.ps1' | & build/New-PowershellModuleFile.ps1 -DestinationPath out/ArmaServer/ArmaServer.psm1 -Force

- name: 'Update manifest version'
shell: pwsh
run: Update-ModuleManifest -ModuleVersion ${{ steps.new-version.outputs.next-version }} out/ArmaServer/ArmaServer.psd1

- name: 'Publish to PSGallery'
uses: aammirmirza/Publish2PSGallery@PSGallery_v2
with:
NuGetApiKey: ${{ secrets.PSGALLERY_APIKEY }}
modulePath: out/ArmaServer
run: build/Release.ps1 -Version ${{ steps.new-version.outputs.next-version }} -ApiKey ${{ secrets.PSGALLERY_APIKEY }}

- name: Tag new version on the repository
uses: arwynfr/actions-conventional-versioning@v1
uses: arwynfr/actions-conventional-versioning@v1
21 changes: 21 additions & 0 deletions build/Release.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[semver]
$Version,

[Parameter(Mandatory)]
[string]
$ApiKey
)

$Root = Convert-Path $PSScriptRoot/..
$Sources = Join-Path $Root src
$Builds = Join-Path $Root build
$Destination = Join-Path $Root out/ArmaServer

Copy-Item $Sources/.templates $Destination/.templates -Recurse -Force
Copy-Item $Builds/ArmaServer.psd1 $Destination/ArmaServer.psd1 -Force
Get-ChildItem $Sources -Filter '*.ps1' | & $Builds/New-PowershellModuleFile.ps1 -DestinationPath $Destination/ArmaServer.psm1 -Force
Update-ModuleManifest -ModuleVersion $Version $Destination/ArmaServer.psd1
Publish-Module -Path $Destination -NuGetApiKey $ApiKey

0 comments on commit 9abd109

Please sign in to comment.