summaryrefslogtreecommitdiffstats
path: root/.github/workflows/release.yml
blob: 03406f4062739c8ac174a85cd1688d45abe2c643 (plain)
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
97
98
99
100
101
102
103
104
105
106
107
name: Release Packages

on:
    release:
        types: [published]

jobs:
    build-ubuntu:
        strategy:
            matrix:
                version: ['14.04', '16.04', '18.04', '19.10', '20.04']
        runs-on: ubuntu-latest
        container:
            image: 'docker://ubuntu:${{ matrix.version }}'
        steps:
            - name: "Get Tag Name"
              id: ref
              shell: bash
              run: |
                  ref="${{ github.ref }}";
                  ref="${ref//refs\/heads\//}";
                  ref="${ref//refs\/tags\//}";
                  ref="${ref//master/dev}";
                  echo "$ref";
                  echo "::set-output name=name::$ref"
            - name: "Checkout project"
              uses: actions/checkout@v2
            - name: "System Setup"
              run: |
                  apt-get update;
                  apt-get --assume-yes -f install curl build-essential libncursesw5-dev pkg-config liblzma-dev;
                  curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs  | sh -s -- --default-toolchain stable -y;
                  $HOME/.cargo/bin/cargo install --force cargo-deb
            - name: "Build Deb"
              run: $HOME/.cargo/bin/cargo +stable deb --output "target/debian/git-interactive-rebase-tool-${{ steps.ref.outputs.name }}-ubuntu-${{ matrix.version }}_amd64.deb"
            - name: "Upload Release"
              uses: softprops/action-gh-release@v1
              with:
                  files: |
                      target/debian/*.deb
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

    build-debian:
        strategy:
            matrix:
                version: ['8', '9', '10', 'bullseye', 'sid']
        runs-on: ubuntu-latest
        container:
            image: 'docker://debian:${{ matrix.version }}-slim'
        steps:
            - name: "Get Tag Name"
              id: ref
              shell: bash
              run: |
                  ref="${{ github.ref }}";
                  ref="${ref//refs\/heads\//}";
                  ref="${ref//refs\/tags\//}";
                  ref="${ref//master/dev}";
                  echo "$ref";
                  echo "::set-output name=name::$ref"
            - name: "Checkout project"
              uses: actions/checkout@v2
            - name: "System Setup"
              run: |
                  apt-get update;
                  apt-get --assume-yes -f install curl build-essential libncursesw5-dev pkg-config liblzma-dev;
                  curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs  | sh -s -- --default-toolchain stable -y;
                  $HOME/.cargo/bin/cargo install --force cargo-deb
            - name: "Build Deb"
              run: $HOME/.cargo/bin/cargo +stable deb --output "target/debian/git-interactive-rebase-tool-${{ steps.ref.outputs.name }}-debian-${{ matrix.version }}_amd64.deb"
            - name: "Upload Release"
              uses: softprops/action-gh-release@v1
              with:
                  files: |
                      target/debian/*.deb
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    build-macos:
        runs-on: [macos]
        steps:
            - name: "Checkout project"
              uses: actions/checkout@v2
            - name: "Build"
              run: "cargo build --release"
            - name: "Rename"
              run: "cp target/release/interactive-rebase-tool target/release/macos-interactive-rebase-tool"
            - name: "Upload Release"
              uses: softprops/action-gh-release@v1
              with:
                  files: target/release/macos-interactive-rebase-tool
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

    build-windows:
        runs-on: [windows-latest]
        steps:
            - name: "Checkout project"
              uses: actions/checkout@v2
            - name: "Build"
              run: "cargo rustc --target x86_64-pc-windows-msvc --release --bin interactive-rebase-tool -- -C lto"
            - name: "Upload Release"
              uses: softprops/action-gh-release@v1
              with:
                  files: target\x86_64-pc-windows-msvc\release\interactive-rebase-tool.exe
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}