mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-26 12:17:19 +02:00
172 lines
4.9 KiB
YAML
172 lines
4.9 KiB
YAML
name: CD
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
push:
|
|
tags:
|
|
- v*
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
call_build:
|
|
uses: ./.github/workflows/build.yml
|
|
|
|
homebrew:
|
|
name: Bump Homebrew formula
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: Update Homebrew formula
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: dawidd6/action-homebrew-bump-formula@v3
|
|
with:
|
|
token: ${{secrets.HOMEBREW_TOKEN}}
|
|
formula: taskwarrior-tui
|
|
|
|
deb:
|
|
name: Publish deb package
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v4
|
|
- uses: clechasseur/rs-cargo@v2
|
|
with:
|
|
command: build
|
|
args: --release
|
|
- name: Install cargo-deb
|
|
run: cargo install cargo-deb
|
|
- name: Build deb package
|
|
run: cargo deb -p taskwarrior-tui -o target/debian/taskwarrior-tui.deb
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: taskwarrior-tui-deb
|
|
path: target/debian/taskwarrior-tui.deb
|
|
- name: Releasing assets
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: |
|
|
target/debian/*.deb
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
rpm:
|
|
name: Publish rpm package
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v4
|
|
- uses: clechasseur/rs-cargo@v2
|
|
with:
|
|
command: build
|
|
args: --release
|
|
- name: Install rpm
|
|
run: sudo apt-get install rpm
|
|
- name: Install cargo-rpm
|
|
run: cargo install cargo-rpm
|
|
- name: Build rpm package
|
|
run: cargo rpm build
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: taskwarrior-tui-rpm
|
|
path: target/release/rpmbuild/RPMS/x86_64/taskwarrior-tui-*.x86_64.rpm
|
|
- name: Releasing assets
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: |
|
|
target/release/rpmbuild/RPMS/x86_64/taskwarrior-tui-*.x86_64.rpm
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
aur:
|
|
name: Publish aur package
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v4
|
|
- uses: clechasseur/rs-cargo@v2
|
|
with:
|
|
command: build
|
|
args: --release
|
|
- name: Install cargo-aur
|
|
run: cargo install cargo-aur
|
|
- name: Build aur package
|
|
run: cargo aur
|
|
|
|
grcov:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
TASKRC: taskwarrior-testdata/.taskrc
|
|
TASKDATA: taskwarrior-testdata/.task
|
|
RUST_BACKTRACE: full
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: sudo apt-get update
|
|
- name: 'Install Taskwarrior'
|
|
uses: ./.github/actions/install-taskwarrior
|
|
with:
|
|
secret_gh_token: ${{ secrets.GITHUB_TOKEN }}
|
|
- run: |
|
|
task --version
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
repository: kdheepak/taskwarrior-testdata
|
|
path: taskwarrior-testdata
|
|
- run: |
|
|
# prepare taskwarrior, initial setup
|
|
task rc.confirmation=off || echo 0
|
|
- name: Install Rust toolchain
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
with:
|
|
toolchain: nightly
|
|
override: true
|
|
components: llvm-tools-preview
|
|
- name: Clean environment for grcov
|
|
uses: clechasseur/rs-cargo@v2
|
|
with:
|
|
command: clean
|
|
- name: Build taskwarrior-tui with coverage
|
|
uses: clechasseur/rs-cargo@v2
|
|
with:
|
|
command: build
|
|
env:
|
|
RUSTFLAGS: "-Cinstrument-coverage"
|
|
- name: Run taskwarrior-tui tests in coverage environment
|
|
uses: clechasseur/rs-cargo@v2
|
|
with:
|
|
command: test
|
|
args: --worksoace
|
|
env:
|
|
RUSTFLAGS: "-Cinstrument-coverage"
|
|
LLVM_PROFILE_FILE: "your_name-%p-%m.profraw"
|
|
- name: Install grcov
|
|
uses: clechasseur/rs-cargo@v2
|
|
with:
|
|
command: install
|
|
args: grcov
|
|
- name: Gather coverage data
|
|
run: |
|
|
mkdir ./target/debug/coverage/
|
|
grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing -o ./target/debug/coverage/
|
|
shell: bash
|
|
- name: Coveralls upload
|
|
uses: coverallsapp/github-action@master
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
parallel: true
|
|
file: ./target/debug/coverage/lcov
|
|
|
|
grcov_finalize:
|
|
runs-on: ubuntu-latest
|
|
needs: grcov
|
|
steps:
|
|
- name: Coveralls finalization
|
|
uses: coverallsapp/github-action@master
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
parallel-finished: true
|