Skip to content

feat: change the default path #3

feat: change the default path

feat: change the default path #3

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
jobs:
build:
name: build (${{ matrix.os }} / ${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: errat-linux-x86_64
binary_name: errat
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
artifact_name: errat-linux-aarch64
binary_name: errat
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: errat-macos-x86_64
binary_name: errat
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: errat-macos-aarch64
binary_name: errat
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: errat-windows-x86_64.exe
binary_name: errat.exe
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Add target
run: rustup target add ${{ matrix.target }}
- name: Install aarch64 linker
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Package
shell: bash
run: |
mkdir -p dist
BIN="target/${{ matrix.target }}/release/${{ matrix.binary_name }}"
cp "$BIN" "dist/${{ matrix.artifact_name }}"
- name: SHA256
shell: bash
run: |
ART="dist/${{ matrix.artifact_name }}"
python - <<'PY'
import hashlib

Check failure on line 64 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

You have an error in your yaml syntax on line 64
from pathlib import Path
import os
path = Path(os.environ['ART'])
h = hashlib.sha256()
h.update(path.read_bytes())
path.with_suffix(path.suffix + '.sha256').write_text(f"{h.hexdigest()} {path.name}\n")
PY
env:
ART: dist/${{ matrix.artifact_name }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: |
dist/${{ matrix.artifact_name }}
dist/${{ matrix.artifact_name }}.sha256
release:
name: publish
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist
- name: Combine checksums
shell: bash
run: |
find dist -name "*.sha256" -type f -print0 | xargs -0 cat > dist/sha256sums.txt
- name: Create Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: dist/**