π Bump version to 0.2.30 (2024-04-16) and release π¦ #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: moto release | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
release: | |
if: contains(github.event.head_commit.message, 'release') | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Cargo Registry and Target Directory | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Setup Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
target: x86_64-pc-windows-msvc | |
- name: Determine Release Tag | |
id: release_tag | |
run: echo "RELEASE_TAG=v$(date +'%Y.%m.%d.%H%M%S')" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Create Release Tag and Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.RELEASE_TAG }} | |
release_name: moto π release ${{ env.RELEASE_TAG }} | |
draft: false | |
prerelease: false | |
- name: Build Rust Project | |
run: cargo build --release --bin moto | |
- name: Check and list files in release directory | |
run: | | |
$releaseDir = "./target/release/" | |
if (Test-Path $releaseDir/moto.exe) { | |
Write-Output "moto.exe exists in the release directory." | |
} else { | |
Write-Output "moto.exe does not exist in the release directory." | |
} | |
Write-Output "Listing all files in the release directory:" | |
Get-ChildItem -Path $releaseDir -Recurse | ForEach-Object { | |
Write-Output "$($_.FullName)" | |
} | |
if (-not (Test-Path $releaseDir/moto.exe)) { | |
exit 1 | |
} | |
shell: pwsh | |
- name: Generate Winget Manifest Files | |
run: | | |
$version = ${{ env.RELEASE_TAG }}.Substring(1) | |
$installerUrl = "https://github.com/moniverse/moto/releases/download/${{ env.RELEASE_TAG }}/moto.exe" | |
$installerSha256 = (Get-FileHash -Path "./target/release/moto.exe" -Algorithm SHA256).Hash | |
$manifestContent = @" | |
PackageIdentifier: Moniverse.Moto | |
PackageVersion: $version | |
DefaultLocale: en-US | |
ManifestType: version | |
ManifestVersion: 1.6.0 | |
"@ | |
Set-Content -Path "moto.yaml" -Value $manifestContent | |
$manifestContent = @" | |
PackageIdentifier: Moniverse.Moto | |
PackageVersion: $version | |
PackageLocale: en-US | |
Publisher: Moniverse | |
PublisherUrl: https://github.com/moniverse | |
PublisherSupportUrl: https://github.com/moniverse/moto/issues | |
Author: Moniverse | |
PackageName: MOTO | |
PackageUrl: https://github.com/moniverse/moto | |
License: MIT | |
LicenseUrl: https://github.com/moniverse/moto/blob/main/LICENSE | |
Copyright: Copyright (c) Moniverse. All rights reserved. | |
CopyrightUrl: https://github.com/moniverse/moto/blob/main/LICENSE | |
ShortDescription: A Versatile Automation & Scripting System | |
Description: |- | |
MOTO is a versatile scripting language and automation tool designed to simplify task automation across various environments and languages. It provides a unified and intuitive syntax for defining tasks, leveraging multiple runtimes, and orchestrating complex workflows. | |
Key Features: | |
- Multi-language Support: MOTO seamlessly integrates with multiple programming languages, including Dart, Rust, Python, JavaScript, and more. You can write code in your preferred language within a single MOTO script. | |
- Custom Runtimes: Extend MOTO's capabilities by defining custom runtimes for additional languages or execution environments. Specify the necessary setup and execution steps for each language. | |
- Task Definition and Execution: Define reusable tasks that encapsulate specific actions or operations. Tasks can be associated with different runtimes and executed seamlessly within the MOTO script. | |
- Shell Execution: Execute shell commands and scripts using the built-in :shell runtime. Integrate with the underlying operating system for file manipulation, process management, and system operations. | |
- Code Generation: Generate code files dynamically using string interpolation and file output redirection. Create source files in different languages based on the script's logic. | |
- Text Blocks: Define reusable text blocks that can be referenced and interpolated within tasks or other blocks. Store common code snippets, templates, or static content for easy reuse. | |
Moniker: moto | |
Tags: | |
- automation | |
- scripting | |
- multi-language | |
- task-runner | |
- code-generation | |
ManifestType: defaultLocale | |
ManifestVersion: 1.6.0 | |
"@ | |
Set-Content -Path "moto.locale.en-US.yaml" -Value $manifestContent | |
$manifestContent = @" | |
PackageIdentifier: Moniverse.Moto | |
PackageVersion: $version | |
Platform: | |
- Windows.Desktop | |
MinimumOSVersion: 10.0.0.0 | |
InstallerType: exe | |
InstallerSwitches: | |
Silent: /S | |
SilentWithProgress: /S | |
UpgradeBehavior: install | |
Installers: | |
- Architecture: x64 | |
InstallerUrl: $installerUrl | |
InstallerSha256: $installerSha256 | |
ManifestType: installer | |
ManifestVersion: 1.6.0 | |
"@ | |
Set-Content -Path "moto.installer.yaml" -Value $manifestContent | |
shell: pwsh | |
- name: Upload Artifacts to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./target/release/moto.exe | |
asset_name: moto.exe | |
asset_content_type: application/octet-stream | |
- name: Upload Winget Manifest Files to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./moto.yaml | |
asset_name: moto.yaml | |
asset_content_type: text/yaml | |
- name: Upload Winget Manifest Files to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./moto.locale.en-US.yaml | |
asset_name: moto.locale.en-US.yaml | |
asset_content_type: text/yaml | |
- name: Upload Winget Manifest Files to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./moto.installer.yaml | |
asset_name: moto.installer.yaml | |
asset_content_type: text/yaml |