gitui/.github/workflows/cd.yml

96 lines
2.6 KiB
YAML
Raw Normal View History

2020-04-13 11:23:55 +03:00
name: CD
on:
push:
2020-04-14 12:43:12 +03:00
tags:
- '*'
2020-04-13 11:23:55 +03:00
jobs:
2020-04-15 17:36:40 +03:00
release:
strategy:
2020-08-29 19:50:19 +03:00
fail-fast: false
2020-04-15 17:36:40 +03:00
matrix:
2020-04-28 12:28:59 +03:00
os: [ubuntu-latest, macos-latest, windows-latest]
2020-04-15 17:36:40 +03:00
runs-on: ${{ matrix.os }}
2020-04-13 11:23:55 +03:00
steps:
- uses: actions/checkout@v2
2020-04-14 12:57:14 +03:00
- name: Get version
id: get_version
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
2020-06-06 20:24:48 +03:00
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
2020-06-06 20:24:48 +03:00
components: clippy
2020-04-14 12:43:12 +03:00
- name: Build
run: cargo build
- name: Run tests
run: make test
- name: Run clippy
2020-04-28 17:02:12 +03:00
run: |
2020-06-06 20:24:48 +03:00
cargo clean
2020-04-28 17:02:12 +03:00
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
2020-04-15 17:36:40 +03:00
- 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
2020-04-28 12:28:59 +03:00
- name: Build Release Win
if: matrix.os == 'windows-latest'
run: make release-win
2020-04-13 11:23:55 +03:00
2020-04-14 12:48:36 +03:00
- name: Set SHA
2020-04-15 17:36:40 +03:00
if: matrix.os == 'macos-latest'
2020-04-14 12:48:36 +03:00
id: shasum
run: |
2020-04-15 17:36:40 +03:00
echo ::set-output name=sha::"$(shasum -a 256 ./release/gitui-mac.tar.gz | awk '{printf $1}')"
2020-04-14 12:48:36 +03:00
2020-05-13 18:17:49 +03:00
- name: Extract release notes
2020-05-16 21:35:42 +03:00
if: matrix.os == 'ubuntu-latest'
2020-05-13 18:17:49 +03:00
id: release_notes
uses: ffurrer2/extract-release-notes@v1
- name: Release
uses: softprops/action-gh-release@v1
2020-04-13 11:23:55 +03:00
with:
2020-05-13 18:17:49 +03:00
body: ${{ steps.release_notes.outputs.release_notes }}
2020-08-29 20:05:07 +03:00
prerelease: ${{ contains(github.ref, '-') }}
files: |
./release/*.tar.gz
./release/*.zip
2020-10-26 03:18:04 +03:00
./release/*.msi
2020-04-13 11:23:55 +03:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2020-07-30 02:10:26 +03:00
# - 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