Update to scripts and readme, workflow added release publishing.

This commit is contained in:
Edward R. Gonzalez 2023-03-30 20:14:51 -04:00
parent d73d22282b
commit 0da1505190
3 changed files with 76 additions and 90 deletions

View File

@ -82,3 +82,74 @@ jobs:
if (-not [string]::IsNullOrEmpty($test)) { $args += $test } if (-not [string]::IsNullOrEmpty($test)) { $args += $test }
& .\scripts\build.ci.ps1 debug test & .\scripts\build.ci.ps1 debug test
- name: Create
shell: pwsh
run: |
New-Item -ItemType Directory -Path "./artifact"
Copy-Item "./build/refactor.exe" -Destination "./artifact/refactor.exe"
Copy-Item "./Readme.md" -Destination "./artifact/Readme.md"
Compress-Archive -Path "./artifact/*" -DestinationPath "./artifact/artifact.zip"
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: artifact
path: ./artifact/artifact.zip
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: artifact
path: ./artifact
- name: Extract artifact
run: |
unzip ./artifact/artifact.zip -d ./artifact
- name: Create GitHub release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload refactor.exe to the release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifact/refactor.exe
asset_name: refactor.exe
asset_content_type: application/octet-stream
- name: Upload README to the release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifact/README.md
asset_name: README.md
asset_content_type: text/markdown

View File

@ -26,8 +26,7 @@ However, the rest of the categorical keywords (word, namespace), can really be u
There is no semantic awareness this is truely just a simple find and replace, but with some filters specifiable, and There is no semantic awareness this is truely just a simple find and replace, but with some filters specifiable, and
words/namespaces only being restricted to the rules for C/C++ identifiers (alphanumeric or underscores only) words/namespaces only being restricted to the rules for C/C++ identifiers (alphanumeric or underscores only)
The main benefit for using this over alts is its problably more ergonomic and performant for large refactors on libraries that The main benefit for using this over alts is its problably more ergonomic and performant for large refactors on libraries you may want to have automated in a script.
you may want to have automated in a script.
There are other programs more robust for doing that sort of thing but I was not able to find something this simple. There are other programs more robust for doing that sort of thing but I was not able to find something this simple.
@ -44,6 +43,7 @@ TODO:
* Possibly come up with a better name. * Possibly come up with a better name.
* Test to see how much needs to be ported for other platforms (if at all) * Test to see how much needs to be ported for other platforms (if at all)
* Setup as api.
* Provide binaries in the release page for github. (debug and release builds) * Provide binaries in the release page for github. (debug and release builds)
* Directive to ignore comments (with a way to specify the comment signature). Right now comments that meet the signature of words or namespaces are refactored. * Directive to ignore comments (with a way to specify the comment signature). Right now comments that meet the signature of words or namespaces are refactored.
* Provide a GUI build.
* Provide as a single-header library.

View File

@ -1,87 +1,2 @@
if ( NOT_HEADLESSS ) cls
{ & (Join-Path $PSScriptRoot 'build.ci.ps1')
cls
}
[string] $type = $null
[string] $test = $false
foreach ( $arg in $args )
{
if ( $arg -eq "test" )
{
$test = $true
}
else
{
$type = $arg
}
}
#region Regular Build
write-host "Building project`n"
$path_root = git rev-parse --show-toplevel
$path_build = Join-Path $path_root build
$path_scripts = Join-Path $path_root scripts
if ( -not( Test-Path $path_build ) )
{
$args_meson = @()
$args_meson += "setup"
$args_meson += $path_build
Start-Process meson $args_meson -NoNewWindow -Wait -WorkingDirectory $path_scripts
}
if ( $type )
{
$args_meson = @()
$args_meson += "configure"
$args_meson += $path_build
$args_meson += "--buildtype $($type)"
Start-Process meson $args_meson -NoNewWindow -Wait -WorkingDirectory $path_scripts
}
$args_ninja = @()
$args_ninja += "-C"
$args_ninja += $path_build
Start-Process ninja $args_ninja -Wait -NoNewWindow -WorkingDirectory $path_root
#endregion Regular Build
if ( $test -eq $true )
{
#region Test Build
write-host "`n`nBuilding Test`n"
# Refactor thirdparty libraries
& (Join-Path $PSScriptRoot 'refactor_and_format.ps1')
$path_test = Join-Path $path_root test
$path_test_build = Join-Path $path_test build
if ( -not( Test-Path $path_test_build ) )
{
$args_meson = @()
$args_meson += "setup"
$args_meson += $path_test_build
Start-Process meson $args_meson -NoNewWindow -Wait -WorkingDirectory $path_test
}
$args_ninja = @()
$args_ninja += "-C"
$args_ninja += $path_test_build
write-host $args_ninja
Start-Process ninja $args_ninja -Wait -NoNewWindow -WorkingDirectory $path_root
#endregion Test Build
}