File: build.yml

package info (click to toggle)
rust-taskwarrior-tui 0.26.7-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 732 kB
  • sloc: sh: 75; makefile: 9
file content (96 lines) | stat: -rw-r--r-- 3,572 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Build
on: 
  pull_request:
  workflow_call:
jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: macOS-latest
            target: x86_64-apple-darwin
            rust_flags: ''
            features: ''
          - 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@v4
        with:
          command: build
          args: --release ${{matrix.features}} --target=${{ matrix.target }}
      - name: Compress binaries
        uses: svenstaro/upx-action@v3
        with:
          files: target/${{ matrix.target }}/release/taskwarrior-tui${{ matrix.binary_postfix }}
          args: ${{ matrix.upx_args }}
          strip: ${{ matrix.strip }}
        # MacOS Compression disabled due to bug https://github.com/upx/upx/blob/44e4bd0b5454ff8aee1ff3376974dfe6014300d9/NEWS#L31  
        if: ${{ matrix.os  != 'macOS-latest' }}
      - 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@v7
        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 }}