Skip to content

Make clippy happy again #2

Make clippy happy again

Make clippy happy again #2

Workflow file for this run

name: Release AIScript
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build AIScript (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: aiscript
asset_name: aiscript-linux-x86_64
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: aiscript
asset_name: aiscript-macos-x86_64
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: aiscript
asset_name: aiscript-macos-arm64
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: aiscript.exe
asset_name: aiscript-windows-x86_64.exe
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Build binary
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.target }}
- name: Move binary to final location
shell: bash
run: |
mkdir -p dist
if [ "${{ matrix.os }}" = "windows-latest" ]; then
cp target/${{ matrix.target }}/release/${{ matrix.artifact_name }} dist/${{ matrix.asset_name }}
else
cp target/${{ matrix.target }}/release/${{ matrix.artifact_name }} dist/${{ matrix.asset_name }}
chmod +x dist/${{ matrix.asset_name }}
fi
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.asset_name }}
path: dist/${{ matrix.asset_name }}
retention-days: 1
if-no-files-found: error
release:
needs: build
name: Create GitHub Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: dist
# Add the install.sh script to the release
- name: Prepare install script
run: |
cp install.sh dist/
chmod +x dist/install.sh
# Generate checksums for all artifacts
- name: Generate checksums
run: |
cd dist
find . -type f -not -path "*/\.*" | grep -v "checksums.txt" | xargs -I{} shasum -a 256 {} > checksums.txt
cat checksums.txt
- name: Prepare release files
run: |
mkdir -p release_files
cp dist/aiscript-linux-x86_64/aiscript-linux-x86_64 release_files/
cp dist/aiscript-macos-x86_64/aiscript-macos-x86_64 release_files/
cp dist/aiscript-macos-arm64/aiscript-macos-arm64 release_files/
cp dist/aiscript-windows-x86_64.exe/aiscript-windows-x86_64.exe release_files/
cp dist/install.sh release_files/
cp dist/checksums.txt release_files/
- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: release_files/*
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}