Skip to content

chore: Release scriptisto version 2.2.0 #29

chore: Release scriptisto version 2.2.0

chore: Release scriptisto version 2.2.0 #29

Workflow file for this run

name: On Release
on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
env:
CARGO_TERM_COLOR: always
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux, macos]
include:
- build: linux
os: ubuntu-22.04
rust: stable
target: x86_64-unknown-linux-musl
- build: macos
os: macos-12
rust: stable
target: x86_64-apple-darwin
steps:
- name: Install Ubuntu tools
if: matrix.os == 'ubuntu-22.04'
run: sudo apt-get update && sudo apt-get install -y musl-tools rpm
- name: Install Mac OS X tools
if: matrix.build == 'macos'
run: brew install coreutils
- name: Checkout sources
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
- name: Build binary
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.target }}
- name: Strip binary
run: strip ./target/${{ matrix.target }}/release/scriptisto
- name: Make bz2
run: |
tar -cjvf ./scriptisto-${{ matrix.target }}.tar.bz2 --directory=./target/${{ matrix.target }}/release scriptisto
sha256sum ./scriptisto-${{ matrix.target }}.tar.bz2
- name: Install tools from crates
if: matrix.build == 'linux'
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-deb cargo-generate-rpm
- name: Copy to standard location
if: matrix.build == 'linux'
run: |
mkdir -p ./target/release
cp ./target/${{ matrix.target }}/release/scriptisto ./target/release/scriptisto
- name: Build RPM
if: matrix.build == 'linux'
run: |
cargo generate-rpm --target ${{ matrix.target }}
sha256sum ./target/${{ matrix.target }}/generate-rpm/*.rpm
- name: Build DEB
if: matrix.build == 'linux'
run: |
cargo deb --no-build --separate-debug-symbols --target ${{ matrix.target }}
sha256sum ./target/${{ matrix.target }}/debian/*.deb
- name: Release Linux
uses: softprops/action-gh-release@v1
if: matrix.build == 'linux' && startsWith(github.ref, 'refs/tags/')
with:
append_body: true
files: |
./scriptisto-${{ matrix.target }}.tar.bz2
./target/${{ matrix.target }}/debian/*.deb
./target/${{ matrix.target }}/generate-rpm/*.rpm
- name: Release Mac OS X
uses: softprops/action-gh-release@v1
if: matrix.build == 'macos' && startsWith(github.ref, 'refs/tags/')
with:
append_body: true
files: |
./scriptisto-${{ matrix.target }}.tar.bz2