Skip to content

Improvements and flows metrics view (#3) #16

Improvements and flows metrics view (#3)

Improvements and flows metrics view (#3) #16

Workflow file for this run

name: CD
on:
push:
tags:
- "v*.*.*"
jobs:
publish:
name: Publishing for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions: write-all
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
rust: [ stable ]
include:
- os: macos-latest
artifact_prefix: macos
target: x86_64-apple-darwin
binary_postfix: ""
- os: ubuntu-latest
artifact_prefix: linux
target: x86_64-unknown-linux-gnu
binary_postfix: ""
- os: windows-latest
artifact_prefix: windows
target: x86_64-pc-windows-msvc
binary_postfix: ".exe"
steps:
- name: Installing Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Installing needed macOS dependencies
if: matrix.os == 'macos-latest'
run: brew install [email protected]
- name: Installing needed Ubuntu dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y -qq pkg-config libssl-dev libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
- name: Checking out sources
uses: actions/checkout@v1
- name: Running cargo build
uses: actions-rs/cargo@v1
with:
command: build
toolchain: ${{ matrix.rust }}
args: --release --target ${{ matrix.target }}
- name: Packaging final binary
shell: bash
run: |
cd target/${{ matrix.target }}/release
BINARY_NAME=tuistash${{ matrix.binary_postfix }}
strip $BINARY_NAME
RELEASE_NAME=tuistash-${{ matrix.artifact_prefix }}
tar czvf $RELEASE_NAME.tar.gz $BINARY_NAME
if [[ ${{ runner.os }} == 'Windows' ]]; then
certutil -hashfile $RELEASE_NAME.tar.gz sha256 | grep -E [A-Fa-f0-9]{64} > $RELEASE_NAME.sha256
else
shasum -a 256 $RELEASE_NAME.tar.gz > $RELEASE_NAME.sha256
fi
- name: Releasing assets
uses: softprops/action-gh-release@v1
with:
files: |
target/${{ matrix.target }}/release/tuistash-${{ matrix.artifact_prefix }}.tar.gz
target/${{ matrix.target }}/release/tuistash-${{ matrix.artifact_prefix }}.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Extract version
id: extract-version
run: |
printf "::set-output name=%s::%s\n" tag-name "${GITHUB_REF#refs/tags/}"
- name: Bump Homebrew formula
uses: mislav/bump-homebrew-formula-action@v2
if: "matrix.os == 'macos-latest' && !contains(github.ref, '-')" # skip pre-releases
with:
formula-name: tuistash
formula-path: Formula/tuistash.rb
homebrew-tap: edmocosta/homebrew-tap
base-branch: main
download-url: https://github.com/edmocosta/tuistash/releases/download/${{ steps.extract-version.outputs.tag-name }}/tuistash-macos.tar.gz
commit-message: |
{{formulaName}} {{version}}
env:
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}