mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-26 12:17:19 +02:00
refactor: Merge build workflows
This commit is contained in:
parent
5d77f74448
commit
ae3984a1e2
2 changed files with 6 additions and 98 deletions
9
.github/workflows/build.yml
vendored
9
.github/workflows/build.yml
vendored
|
@ -1,5 +1,7 @@
|
||||||
name: Build
|
name: Build
|
||||||
on: [pull_request]
|
on:
|
||||||
|
pull_request:
|
||||||
|
workflow_call:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -11,9 +13,6 @@ jobs:
|
||||||
target: x86_64-apple-darwin
|
target: x86_64-apple-darwin
|
||||||
rust_flags: ''
|
rust_flags: ''
|
||||||
features: ''
|
features: ''
|
||||||
binary_postfix: ''
|
|
||||||
upx_args: --best
|
|
||||||
strip: true
|
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
target: x86_64-unknown-linux-gnu
|
target: x86_64-unknown-linux-gnu
|
||||||
rust_flags: ''
|
rust_flags: ''
|
||||||
|
@ -66,7 +65,7 @@ jobs:
|
||||||
- name: Compress binaries
|
- name: Compress binaries
|
||||||
uses: svenstaro/upx-action@v2
|
uses: svenstaro/upx-action@v2
|
||||||
with:
|
with:
|
||||||
file: target/${{ matrix.target }}/release/taskwarrior-tui${{ matrix.binary_postfix }}
|
files: target/${{ matrix.target }}/release/taskwarrior-tui${{ matrix.binary_postfix }}
|
||||||
args: ${{ matrix.upx_args }}
|
args: ${{ matrix.upx_args }}
|
||||||
strip: ${{ matrix.strip }}
|
strip: ${{ matrix.strip }}
|
||||||
# MacOS Compression disabled due to bug https://github.com/upx/upx/blob/44e4bd0b5454ff8aee1ff3376974dfe6014300d9/NEWS#L31
|
# MacOS Compression disabled due to bug https://github.com/upx/upx/blob/44e4bd0b5454ff8aee1ff3376974dfe6014300d9/NEWS#L31
|
||||||
|
|
95
.github/workflows/cd.yml
vendored
95
.github/workflows/cd.yml
vendored
|
@ -11,99 +11,8 @@ permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
call_build:
|
||||||
runs-on: ${{ matrix.os }}
|
uses: ./.github/workflows/build.yml
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: macOS-latest
|
|
||||||
target: x86_64-apple-darwin
|
|
||||||
rust_flags: ""
|
|
||||||
features: ""
|
|
||||||
binary_postfix: ""
|
|
||||||
upx_args: --best
|
|
||||||
strip: true
|
|
||||||
- os: ubuntu-latest
|
|
||||||
target: x86_64-unknown-linux-gnu
|
|
||||||
rust_flags: ""
|
|
||||||
features: ""
|
|
||||||
binary_postfix: ""
|
|
||||||
upx_args: --best --lzma
|
|
||||||
strip: true
|
|
||||||
- os: ubuntu-latest
|
|
||||||
target: x86_64-unknown-linux-musl
|
|
||||||
rust_flags: ""
|
|
||||||
features: ""
|
|
||||||
binary: "taskwarrior-tui-x86_64-unknown-linux-musl"
|
|
||||||
upx_args: --best --lzma
|
|
||||||
strip: true
|
|
||||||
- os: windows-latest
|
|
||||||
target: x86_64-pc-windows-gnu
|
|
||||||
rust_flags: -C target-feature=+crt-static
|
|
||||||
features: ""
|
|
||||||
binary_postfix: ".exe"
|
|
||||||
upx_args: -9
|
|
||||||
strip: false
|
|
||||||
- os: windows-latest
|
|
||||||
target: x86_64-pc-windows-msvc
|
|
||||||
rust_flags: -C target-feature=+crt-static
|
|
||||||
features: ""
|
|
||||||
binary_postfix: ".exe"
|
|
||||||
upx_args: -9
|
|
||||||
strip: false
|
|
||||||
- os: windows-latest
|
|
||||||
target: i686-pc-windows-msvc
|
|
||||||
rust_flags: -C target-feature=+crt-static
|
|
||||||
features: ""
|
|
||||||
binary_postfix: ".exe"
|
|
||||||
upx_args: -9
|
|
||||||
strip: false
|
|
||||||
env:
|
|
||||||
RUSTFLAGS: ${{ matrix.rust_flags }}
|
|
||||||
MACOSX_DEPLOYMENT_TARGET: 10.7
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@master
|
|
||||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
target: ${{ matrix.target }}
|
|
||||||
override: true
|
|
||||||
- uses: clechasseur/rs-cargo@v2
|
|
||||||
with:
|
|
||||||
command: build
|
|
||||||
args: --release ${{matrix.features}} --target=${{ matrix.target }}
|
|
||||||
- name: Compress binaries
|
|
||||||
uses: svenstaro/upx-action@v2
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
target/${{ matrix.target }}/release/taskwarrior-tui${{ matrix.binary_postfix }}
|
|
||||||
args: ${{ matrix.upx_args }}
|
|
||||||
strip: ${{ matrix.strip }}
|
|
||||||
- name: Packaging binary
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd target/${{ matrix.target }}/release
|
|
||||||
tar czvf taskwarrior-tui-${{ matrix.target }}.tar.gz taskwarrior-tui${{ matrix.binary_postfix }}
|
|
||||||
if [[ ${{ runner.os }} == 'Windows' ]]; then
|
|
||||||
certutil -hashfile taskwarrior-tui-${{ matrix.target }}.tar.gz sha256 | grep -E [A-Fa-f0-9]{64} > taskwarrior-tui-${{ matrix.target }}.sha256
|
|
||||||
else
|
|
||||||
shasum -a 256 taskwarrior-tui-${{ matrix.target }}.tar.gz > taskwarrior-tui-${{ matrix.target }}.sha256
|
|
||||||
fi
|
|
||||||
- name: Upload artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: taskwarrior-tui-${{ matrix.target }}
|
|
||||||
path: target/${{ matrix.target }}/release/taskwarrior-tui-${{ matrix.target }}.tar.gz
|
|
||||||
- name: Releasing assets
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
target/${{ matrix.target }}/release/taskwarrior-tui-${{ matrix.target }}.tar.gz
|
|
||||||
target/${{ matrix.target }}/release/taskwarrior-tui-${{ matrix.target }}.sha256
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
homebrew:
|
homebrew:
|
||||||
name: Bump Homebrew formula
|
name: Bump Homebrew formula
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue