Skip to content

Commit

Permalink
Fine-tune release script
Browse files Browse the repository at this point in the history
  • Loading branch information
ylabonte committed Feb 26, 2024
1 parent 7e6669e commit c5eb1db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release

on:
push:
tags: [v*]
tags: [WindowsEnvLoader-v*]

jobs:
release:
Expand All @@ -19,6 +19,12 @@ jobs:
git config --global user.name github-actions
git config --global user.email github-actions@github.com
- name: Run release script
- name: Build and publish via Github Pages
shell: pwsh
run: ./release.ps1
run: ./WindowsEnvLoader/release.ps1

- name: Add Setup.exe to Release Assets
uses: softprops/action-gh-release@v1
with:
files: WindowsEnvLoader/bin/publish/setup.exe

10 changes: 4 additions & 6 deletions WindowsEnvLoader/release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $tag = $(git describe --tags)
Write-Output "Tag: $tag"

# Parse tag into a three-number version.
$version = $tag.Split('-')[0].TrimStart('v')
$version = $tag.Split('-')[1].TrimStart('v')
$version = "$version.0"
Write-Output "Version: $version"

Expand All @@ -34,7 +34,7 @@ $outDir = "$projDir/$publishDir"
if (Test-Path $outDir) {
Remove-Item -Path $outDir -Recurse
}
git

# Publish the application.
Push-Location $projDir
try {
Expand Down Expand Up @@ -78,18 +78,16 @@ try {
if (Test-Path "$appName") {
Remove-Item -Path "$appName" -Recurse
}
New-Item -Path "$appName"

# Copy new application files.
Write-Output "Copying new files..."
Copy-Item -Path "../$outDir/Application Files","../$outDir/$appName.application" `
-Destination ".\$appName" -Recurse
Copy-Item -Path "../$outDir" -Destination ".\$appName" -Recurse

# Stage and commit.
Write-Output "Staging..."
git add -A
Write-Output "Committing..."
git commit -m "Update to v$version"
git commit -m "Update to WindowsEnvLoader v$version"

# Push.
git push
Expand Down

0 comments on commit c5eb1db

Please sign in to comment.