summaryrefslogtreecommitdiffstats
path: root/.github/workflows/release.yml
blob: 2c2cd7f4988a463654a50ceb591d0d4a67a05d0a (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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: Release Packages

on:
    release:
        types: [published]

jobs:
    build-ubuntu-legacy:
        strategy:
            matrix:
                version: ['14.04', '16.04']
        runs-on: ubuntu-latest
        timeout-minutes: 10
        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 pkg-config;
                  curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs  | sh -s -- --default-toolchain stable -y;
                  $HOME/.cargo/bin/cargo install --force cargo-deb
              env:
                  DEBIAN_FRONTEND: noninteractive
                  TZ: "America/St_Johns"
            - 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-ubuntu:
        strategy:
            matrix:
                version: ['18.04', '20.04', '22.04']
        runs-on: ubuntu-latest
        timeout-minutes: 10
        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 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
              env:
                  DEBIAN_FRONTEND: noninteractive
                  TZ: "America/St_Johns"
            - 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-legacy:
        strategy:
            matrix:
                version: ['8']
        runs-on: ubuntu-latest
        timeout-minutes: 10
        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 pkg-config;
                  curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs  | sh -s -- --default-toolchain stable -y;
                  $HOME/.cargo/bin/cargo install --force cargo-deb
              env:
                  DEBIAN_FRONTEND: noninteractive
                  TZ: "America/St_Johns"
            - 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-debian:
        strategy:
            matrix:
                version: ['9', '10', 'bullseye', 'sid']
        runs-on: ubuntu-latest
        timeout-minutes: 10
        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 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
              env:
                  DEBIAN_FRONTEND: noninteractive
                  TZ: "America/St_Johns"
            - 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-latest]
        timeout-minutes: 5
        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]
        timeout-minutes: 10
        steps:
            - name: "Checkout project"
              uses: actions/checkout@v2
            - name: "Build"
              run: "cargo rustc --target x86_64-pc-windows-msvc --release --bin interactive-rebase-tool"
            - 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 }}