Skip to content

Build, Upload, and Create GitHub Release #18

Build, Upload, and Create GitHub Release

Build, Upload, and Create GitHub Release #18

Workflow file for this run

name: Build, Upload, and Create GitHub Release
on:
push:
tags:
- "v*"
jobs:
build-and-release:

Check failure on line 9 in .github/workflows/release.yaml

View workflow run for this annotation

GitHub Actions / Build, Upload, and Create GitHub Release

Invalid workflow file

The workflow is not valid. .github/workflows/release.yaml (Line: 9, Col: 3): The workflow must contain at least one job with no dependencies.
name: Build and upload
runs-on: ${{ matrix.os }}
needs: test
strategy:
matrix:
include:
- os: ubuntu-22.04
target: x86_64-unknown-linux-musl
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
# - os: windows-latest
# target: x86_64-pc-windows-gnu
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get the release version from the tag
shell: bash
run: echo "VERSION=$(git describe --tags --always)" >> $GITHUB_ENV
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
- run: cargo test
- name: Build the project
run: cargo build --release --target ${{ matrix.target }}
- name: Build archive
shell: bash
if: startsWith(github.ref, 'refs/tags/')
run: |
binary_name="checksum"
dirname="$binary_name-${{ env.VERSION }}-${{ matrix.target }}"
mkdir "$dirname"
# TODO: Resolve issues with windows builds failing
# if [ "${{ matrix.os }}" = "windows-latest" ]; then
# mv "target/${{ matrix.target }}/release/$binary_name.exe" "$dirname"
# 7z a "$dirname.zip" "$dirname"
# echo "ASSET=$dirname.zip" >> $GITHUB_ENV
# else
mv "target/${{ matrix.target }}/release/$binary_name" "$dirname"
tar -czf "$dirname.tar.gz" "$dirname"
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV
# fi
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ env.ASSET }}