gitui/.github/workflows/cd.yml
Stephan D 4a0e58ae15
msrv 160 (#1279)
* bump edition
* msrv 160
* upgrade clap and more deps
2022-08-17 16:30:54 +02:00

95 lines
2.5 KiB
YAML

name: CD
on:
push:
tags:
- '*'
jobs:
release:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Get version
id: get_version
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: clippy
- name: Build
run: cargo build
- name: Run tests
run: make test
- name: Run clippy
run: |
cargo clean
make clippy
- name: Setup MUSL
if: matrix.os == 'ubuntu-latest'
run: |
rustup target add x86_64-unknown-linux-musl
sudo apt-get -qq install musl-tools
- name: Build Release Mac
if: matrix.os == 'macos-latest'
run: make release-mac
- name: Build Release Linux
if: matrix.os == 'ubuntu-latest'
run: make release-linux-musl
- name: Build Release Win
if: matrix.os == 'windows-latest'
run: make release-win
- name: Set SHA
if: matrix.os == 'macos-latest'
id: shasum
run: |
echo ::set-output name=sha::"$(shasum -a 256 ./release/gitui-mac.tar.gz | awk '{printf $1}')"
- name: Extract release notes
if: matrix.os == 'ubuntu-latest'
id: release_notes
uses: ffurrer2/extract-release-notes@v1
- name: Release
uses: softprops/action-gh-release@v1
with:
body: ${{ steps.release_notes.outputs.release_notes }}
prerelease: ${{ contains(github.ref, '-') }}
files: |
./release/*.tar.gz
./release/*.zip
./release/*.msi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Bump personal tap formula
# uses: mislav/bump-homebrew-formula-action@v1
# if: "matrix.os == 'macos-latest' && !contains(github.ref, '-')" # skip prereleases
# env:
# COMMITTER_TOKEN: ${{ secrets.BREW_TOKEN }}
# with:
# formula-name: gitui
# homebrew-tap: extrawurst/tap
# download-url: https://github.com/extrawurst/gitui/releases/download/${{ steps.get_version.outputs.version }}/gitui-mac.tar.gz
- name: Bump homebrew-core formula
uses: mislav/bump-homebrew-formula-action@v1
if: "matrix.os == 'macos-latest' && !contains(github.ref, '-')" # skip prereleases
env:
COMMITTER_TOKEN: ${{ secrets.BREW_TOKEN }}
with:
formula-name: gitui