mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 04:19:41 -08:00
parent
77cd537501
commit
4bcd98cda7
12
.github/workflows/release.yml
vendored
12
.github/workflows/release.yml
vendored
|
@ -173,7 +173,7 @@ jobs:
|
||||||
- name: Pack and push
|
- name: Pack and push
|
||||||
run: ./deploy.ps1 -BinVersion ${{ needs.release.outputs.version }} -ModuleVersion ${{ needs.release.outputs.version }} -Repository PSGallery -RepositoryAPIKey $env:PSGALLERY_KEY
|
run: ./deploy.ps1 -BinVersion ${{ needs.release.outputs.version }} -ModuleVersion ${{ needs.release.outputs.version }} -Repository PSGallery -RepositoryAPIKey $env:PSGALLERY_KEY
|
||||||
scoop:
|
scoop:
|
||||||
needs: [release, artifacts, themes]
|
needs: [release, artifacts]
|
||||||
if: ${{ needs.release.outputs.skipped == 'false' }}
|
if: ${{ needs.release.outputs.skipped == 'false' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
defaults:
|
defaults:
|
||||||
|
@ -184,7 +184,7 @@ jobs:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Update Template
|
- name: Update Template
|
||||||
run: ./build.ps1 -Version ${{ needs.release.outputs.version }} -LinuxSHA ${{ needs.artifacts.outputs.hash_linux }} -WindowsSHA ${{ needs.artifacts.outputs.hash_windows }} -ThemesSHA ${{ needs.themes.outputs.hash_themes }}
|
run: ./build.ps1 -Version ${{ needs.release.outputs.version }}
|
||||||
- name: Upload Scoop JSON
|
- name: Upload Scoop JSON
|
||||||
id: upload-scoop-json
|
id: upload-scoop-json
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
|
@ -195,13 +195,13 @@ jobs:
|
||||||
asset_path: ${{ github.workspace }}/packages/scoop/oh-my-posh.json
|
asset_path: ${{ github.workspace }}/packages/scoop/oh-my-posh.json
|
||||||
asset_name: oh-my-posh.json
|
asset_name: oh-my-posh.json
|
||||||
asset_content_type: text/plain
|
asset_content_type: text/plain
|
||||||
- name: Upload Scoop Post Install
|
- name: Upload Scoop Archive
|
||||||
id: upload-scoop-post-install
|
id: upload-scoop-post-install
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
upload_url: ${{ needs.release.outputs.upload_url }}
|
||||||
asset_path: ${{ github.workspace }}/packages/scoop/post-install.ps1
|
asset_path: ${{ github.workspace }}/packages/scoop/posh-windows-wsl-amd64.7z
|
||||||
asset_name: post-install.ps1
|
asset_name: posh-windows-wsl-amd64.7z
|
||||||
asset_content_type: text/plain
|
asset_content_type: application/octet-stream
|
||||||
|
|
|
@ -2,23 +2,27 @@ Param
|
||||||
(
|
(
|
||||||
[parameter(Mandatory = $true)]
|
[parameter(Mandatory = $true)]
|
||||||
[string]
|
[string]
|
||||||
$Version,
|
$Version
|
||||||
[parameter(Mandatory = $true)]
|
|
||||||
[string]
|
|
||||||
$LinuxSHA,
|
|
||||||
[parameter(Mandatory = $true)]
|
|
||||||
[string]
|
|
||||||
$WindowsSHA,
|
|
||||||
[parameter(Mandatory = $true)]
|
|
||||||
[string]
|
|
||||||
$ThemesSHA
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
New-Item -Path "." -Name "bin" -ItemType Directory
|
||||||
|
Copy-Item -Path "../../themes" -Destination "./bin" -Recurse
|
||||||
|
|
||||||
|
# Download the files and pack them
|
||||||
|
@{name = 'posh-windows-amd64.exe'; outName = 'oh-my-posh.exe' }, @{name = 'posh-linux-amd64'; outName = 'oh-my-posh-wsl' } | ForEach-Object -Process {
|
||||||
|
$download = "https://github.com/jandedobbeleer/oh-my-posh3/releases/download/v$Version/$($_.name)"
|
||||||
|
Invoke-WebRequest $download -Out "./bin/$($_.outName)"
|
||||||
|
}
|
||||||
|
$compress = @{
|
||||||
|
Path = "./bin/*"
|
||||||
|
CompressionLevel = "Fastest"
|
||||||
|
DestinationPath = "./posh-windows-wsl-amd64.7z"
|
||||||
|
}
|
||||||
|
Compress-Archive @compress
|
||||||
|
$zipHash = Get-FileHash ./posh-windows-wsl-amd64.7z -Algorithm SHA256
|
||||||
$content = Get-Content '.\oh-my-posh.json' -Raw
|
$content = Get-Content '.\oh-my-posh.json' -Raw
|
||||||
$content = $content.Replace('<VERSION>', $Version)
|
$content = $content.Replace('<VERSION>', $Version)
|
||||||
$content = $content.Replace('<HASH_LINUX>', $LinuxSHA)
|
$content = $content.Replace('<HASH>', $zipHash.Hash)
|
||||||
$content = $content.Replace('<HASH_WINDOWS>', $WindowsSHA)
|
$content | Out-File -Encoding 'UTF8' './oh-my-posh.json'
|
||||||
$fileHash = Get-FileHash post-install.ps1 -Algorithm SHA256
|
|
||||||
$content = $content.Replace('<HASH_INSTALL_SCRIPT>', $fileHash.Hash)
|
Remove-Item ./bin/ -Recurse
|
||||||
$content = $content.Replace('<HASH_THEMES>', $ThemesSHA)
|
|
||||||
$content | Out-File -Encoding 'UTF8' '.\oh-my-posh.json'
|
|
||||||
|
|
|
@ -6,19 +6,31 @@
|
||||||
"identifier": "GPL-3.0-only",
|
"identifier": "GPL-3.0-only",
|
||||||
"url": "https://github.com/JanDeDobbeleer/oh-my-posh3/blob/main/COPYING"
|
"url": "https://github.com/JanDeDobbeleer/oh-my-posh3/blob/main/COPYING"
|
||||||
},
|
},
|
||||||
"url": [
|
"architecture": {
|
||||||
"https://github.com/JanDeDobbeleer/oh-my-posh3/releases/download/v<VERSION>/posh-linux-amd64",
|
"64bit": {
|
||||||
"https://github.com/JanDeDobbeleer/oh-my-posh3/releases/download/v<VERSION>/posh-windows-amd64.exe",
|
"url": "https://github.com/JanDeDobbeleer/oh-my-posh3/releases/download/v<VERSION>/posh-windows-wsl-amd64.7z",
|
||||||
"https://github.com/JanDeDobbeleer/oh-my-posh3/releases/download/v<VERSION>/post-install.ps1",
|
"hash": "<HASH>"
|
||||||
"https://github.com/JanDeDobbeleer/oh-my-posh3/releases/download/v<VERSION>/themes.zip"
|
}
|
||||||
],
|
},
|
||||||
"hash": [
|
"bin": [
|
||||||
"<HASH_LINUX>",
|
"oh-my-posh-wsl",
|
||||||
"<HASH_WINDOWS>",
|
"oh-my-posh.exe"
|
||||||
"<HASH_INSTALL_SCRIPT>",
|
],
|
||||||
"<HASH_THEMES>"
|
"checkver": {
|
||||||
],
|
"github": "https://github.com/JanDeDobbeleer/oh-my-posh3"
|
||||||
"extract_to": "themes",
|
},
|
||||||
"post_install": "& \"$dir/post-install.ps1\"",
|
"post_install": [
|
||||||
"bin": ["posh-linux-amd64", "posh-windows-amd64.exe"]
|
"Write-Host 'Thanks for installing Oh my Posh.'",
|
||||||
|
"Write-Host 'Have a look at https://ohmyposh.dev/docs/installation for detailed instructions for your shell.'"
|
||||||
|
],
|
||||||
|
"autoupdate": {
|
||||||
|
"architecture": {
|
||||||
|
"64bit": {
|
||||||
|
"url": "https://github.com/JanDeDobbeleer/oh-my-posh3/releases/download/v$version/posh-windows-wsl-amd64.7z",
|
||||||
|
"hash": {
|
||||||
|
"url": "$url.sha256"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
$logo = @'
|
|
||||||
__ _____ _ ___ ___ ______ _ __
|
|
||||||
/ / | _ | | | \/ | | ___ \ | | \ \
|
|
||||||
/ / | | | | |__ | . . |_ _ | |_/ /__ ___| |__ \ \
|
|
||||||
< < | | | | '_ \ | |\/| | | | | | __/ _ \/ __| '_ \ > >
|
|
||||||
\ \ \ \_/ / | | | | | | | |_| | | | | (_) \__ \ | | | / /
|
|
||||||
\_\ \___/|_| |_| \_| |_/\__, | \_| \___/|___/_| |_| /_/
|
|
||||||
__/ |
|
|
||||||
|___/
|
|
||||||
'@
|
|
||||||
Write-Host $logo
|
|
||||||
Write-Host ''
|
|
||||||
Write-Host 'Thanks for installing Oh my Posh.'
|
|
||||||
Write-Host 'Have a look at https://ohmyposh.dev/docs/installation for detailed instructions for your shell.'
|
|
Loading…
Reference in a new issue