ci(publish): test #12
Workflow file for this run
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: publish | ||
on: | ||
push: | ||
branches: ["dev"] | ||
workflow_dispatch: | ||
env: | ||
CARGO_TERM_COLOR: always | ||
permissions: | ||
contents: write | ||
jobs: | ||
build-and-upload: | ||
runs-on: ${{ matrix.os }} | ||
outputs: | ||
upload_url: ${{ env.RELEASE_UPLOAD_URL }} | ||
version: ${{ env.VERSION }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- build: linux | ||
os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
- build: macos | ||
os: macos-latest | ||
target: x86_64-apple-darwin | ||
- build: windows-gnu | ||
os: windows-latest | ||
target: x86_64-pc-windows-gnu | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Rust Tools | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
targets: ${{ matrix.target }} | ||
components: rustfmt, clippy, llvm-tools | ||
- name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
- name: Format with rustfmt | ||
run: | | ||
make format-check | ||
- name: Lint with clippy | ||
run: | | ||
make lint | ||
- name: Test with llvm-cov | ||
run: | | ||
make test | ||
- name: Get the release version from the tag | ||
shell: bash | ||
if: env.VERSION == '' | ||
run: | | ||
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
echo "version is: ${{ env.VERSION }}" | ||
- name: Build | ||
run: | | ||
make build | ||
- name: Build archive | ||
shell: bash | ||
run: | | ||
Check failure on line 74 in .github/workflows/publish.yml GitHub Actions / publishInvalid workflow file
|
||
# Replace with the name of your binary | ||
binary_name="${{ github.event.repository.name }}" | ||
dirname="$binary_name-${{ build-and-upload.outputs.version }}-${{ matrix.target }}" | ||
mkdir "$dirname" | ||
if [ "${{ matrix.os }}" = "windows-latest" ]; then | ||
mv "target/${{ matrix.target }}/release/$binary_name.exe" "$dirname" | ||
else | ||
mv "target/${{ matrix.target }}/release/$binary_name" "$dirname" | ||
fi | ||
if [ "${{ matrix.os }}" = "windows-latest" ]; then | ||
7z a "$dirname.zip" "$dirname" | ||
echo "ASSET=$dirname.zip" >> $GITHUB_ENV | ||
else | ||
tar -czf "$dirname.tar.gz" "$dirname" | ||
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV | ||
fi | ||
- name: Upload the binaries | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
${{ env.ASSET }} |