Skip to content

ci(publish): test

ci(publish): test #12

Workflow file for this run

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

View workflow run for this annotation

GitHub Actions / publish

Invalid workflow file

The workflow is not valid. .github/workflows/publish.yml (Line: 74, Col: 12): Unrecognized named-value: 'build-and-upload'. Located at position 1 within expression: build-and-upload.outputs.version
# 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 }}