Skip to content

Add coverage badge + fix CI (#4550) #76

Add coverage badge + fix CI (#4550)

Add coverage badge + fix CI (#4550) #76

Workflow file for this run

name: CD
on:
push:
tags:
- TEST.*
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
platform: [x86_64, arm64]
include:
- os: ubuntu-latest
platform: x86_64
target: x86_64-unknown-linux-gnu
name: release_linux.tar.gz
- os: ubuntu-latest
platform: arm64
target: aarch64-unknown-linux-gnu
name: release_linux_arm64.tar.gz
- os: windows-latest
platform: x86_64
target: x86_64-pc-windows-gnu
name: release_windows.zip
- os: macOS-latest
platform: x86_64
target: x86_64-apple-darwin
name: release_macos.tar.gz
- os: macOS-latest
platform: arm64
target: aarch64-apple-darwin
name: release_macos_aarch64.tar.gz
exclude:
- os: windows-latest
platform: arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- uses: ilammy/setup-nasm@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.72.1
target: ${{ matrix.target }}
override: true
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/cargo@v1
if: matrix.platform != 'arm64'
with:
command: build
args: --release
- uses: actions-rs/cargo@v1
if: matrix.platform == 'arm64'
with:
use-cross: true
command: build
args: --release --target ${{ matrix.target }}
- name: Package
shell: bash
run: |
mkdir massa && cd massa && mkdir massa-node && mkdir massa-client
if [[ "${{ matrix.platform }}" == "arm64" ]]
then
cp -v ../target/${{ matrix.target }}/release/massa-node massa-node/massa-node
cp -v ../target/${{ matrix.target }}/release/massa-client massa-client/massa-client
else
cp -v ../target/release/massa-node massa-node/massa-node
cp -v ../target/release/massa-client massa-client/massa-client
fi
cp -rv ../massa-node/config massa-node/config
cp -rv ../massa-node/base_config massa-node/base_config
cp -rv ../massa-node/storage massa-node/storage
cp -rv ../massa-client/config massa-client/config
cp -rv ../massa-client/base_config massa-client/base_config
cd ..
if [[ "${{ matrix.os }}" == "windows-latest" ]]
then
7z a massa_${GITHUB_REF/refs\/tags\//}_${{ matrix.name }} massa
else
tar czvf massa_${GITHUB_REF/refs\/tags\//}_${{ matrix.name }} massa
fi
cd -
working-directory: ${{ github.workspace }}
- name: Create Checksums
id: checksums
run: |
checksums=""
for file in massa/*.{gz,zip}; do
if [ -f "$file" ]; then
checksum=$(sha256sum "$file" | cut -d ' ' -f 1)
checksums="$checksums\n$checksum $(basename $file)"
fi
done
echo -e "$checksums" > checksums.txt
working-directory: ${{ github.workspace }}
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: |
massa_*.zip
massa_*.gz
checksums.txt