mirror of
https://github.com/lexmount/moli.git
synced 2026-09-23 08:01:28 +00:00
Add Moli skills and release installers
This commit is contained in:
@@ -95,10 +95,14 @@ jobs:
|
||||
apt-get update
|
||||
apt-get install --yes --no-install-recommends binutils python3
|
||||
|
||||
- name: Validate shell installer
|
||||
shell: bash
|
||||
run: sh -n scripts/install.sh
|
||||
|
||||
- name: Build and package
|
||||
shell: bash
|
||||
run: >-
|
||||
scripts/release.sh
|
||||
python3 scripts/release.py
|
||||
--version "${{ needs.validate.outputs.version }}"
|
||||
--expected-target x86_64-unknown-linux-gnu
|
||||
|
||||
@@ -147,7 +151,7 @@ jobs:
|
||||
- name: Build and package
|
||||
shell: bash
|
||||
run: >-
|
||||
scripts/release.sh
|
||||
python3 scripts/release.py
|
||||
--version "${{ needs.validate.outputs.version }}"
|
||||
--expected-target "${{ matrix.target }}"
|
||||
|
||||
@@ -180,6 +184,21 @@ jobs:
|
||||
rustup toolchain install $toolchain --profile minimal --no-self-update
|
||||
rustc --version
|
||||
|
||||
- name: Validate PowerShell installer
|
||||
shell: pwsh
|
||||
run: |
|
||||
$tokens = $null
|
||||
$parseErrors = $null
|
||||
[System.Management.Automation.Language.Parser]::ParseFile(
|
||||
(Resolve-Path scripts/install.ps1),
|
||||
[ref] $tokens,
|
||||
[ref] $parseErrors
|
||||
) | Out-Null
|
||||
if ($parseErrors.Count -ne 0) {
|
||||
$parseErrors | ForEach-Object { Write-Error $_ }
|
||||
exit 1
|
||||
}
|
||||
|
||||
- name: Build and package
|
||||
shell: pwsh
|
||||
run: >-
|
||||
@@ -209,6 +228,11 @@ jobs:
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Download packaged artifacts
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
@@ -216,26 +240,33 @@ jobs:
|
||||
path: dist
|
||||
merge-multiple: true
|
||||
|
||||
- name: Add stable installers
|
||||
shell: bash
|
||||
run: |
|
||||
install -m 0755 scripts/install.sh dist/moli-installer.sh
|
||||
install -m 0644 scripts/install.ps1 dist/moli-installer.ps1
|
||||
|
||||
- name: Verify release assets
|
||||
shell: bash
|
||||
env:
|
||||
RELEASE_VERSION: ${{ needs.validate.outputs.version }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
expected_archives=(
|
||||
"moli-v${RELEASE_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
|
||||
"moli-v${RELEASE_VERSION}-x86_64-apple-darwin.tar.gz"
|
||||
"moli-v${RELEASE_VERSION}-aarch64-apple-darwin.tar.gz"
|
||||
"moli-v${RELEASE_VERSION}-x86_64-pc-windows-msvc.zip"
|
||||
"moli-x86_64-unknown-linux-gnu.tar.gz"
|
||||
"moli-x86_64-apple-darwin.tar.gz"
|
||||
"moli-aarch64-apple-darwin.tar.gz"
|
||||
"moli-x86_64-pc-windows-msvc.zip"
|
||||
)
|
||||
for archive in "${expected_archives[@]}"; do
|
||||
test -f "dist/$archive"
|
||||
done
|
||||
test -f dist/moli-installer.sh
|
||||
test -f dist/moli-installer.ps1
|
||||
sh -n dist/moli-installer.sh
|
||||
|
||||
artifact_count=$(find dist -maxdepth 1 -type f | wc -l)
|
||||
if [[ "$artifact_count" -ne 4 ]]; then
|
||||
echo "Expected 4 release assets, found $artifact_count." >&2
|
||||
if [[ "$artifact_count" -ne 6 ]]; then
|
||||
echo "Expected 6 release assets, found $artifact_count." >&2
|
||||
find dist -maxdepth 1 -type f -print >&2
|
||||
exit 1
|
||||
fi
|
||||
@@ -245,18 +276,12 @@ jobs:
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
RELEASE_TAG: ${{ needs.validate.outputs.tag }}
|
||||
RELEASE_VERSION: ${{ needs.validate.outputs.version }}
|
||||
RELEASE_DRAFT: ${{ inputs.draft }}
|
||||
RELEASE_PRERELEASE: ${{ inputs.prerelease }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
assets=(
|
||||
"dist/moli-v${RELEASE_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
|
||||
"dist/moli-v${RELEASE_VERSION}-x86_64-apple-darwin.tar.gz"
|
||||
"dist/moli-v${RELEASE_VERSION}-aarch64-apple-darwin.tar.gz"
|
||||
"dist/moli-v${RELEASE_VERSION}-x86_64-pc-windows-msvc.zip"
|
||||
)
|
||||
assets=(dist/*)
|
||||
args=(
|
||||
release create "$RELEASE_TAG"
|
||||
"${assets[@]}"
|
||||
@@ -267,6 +292,8 @@ jobs:
|
||||
)
|
||||
if [[ "$RELEASE_PRERELEASE" == true ]]; then
|
||||
args+=(--prerelease)
|
||||
elif [[ "$RELEASE_DRAFT" != true ]]; then
|
||||
args+=(--latest)
|
||||
fi
|
||||
if [[ "$RELEASE_DRAFT" == true ]]; then
|
||||
args+=(--draft)
|
||||
|
||||
Reference in New Issue
Block a user