@@ -2,13 +2,13 @@ name: CD
22
33on :
44 push :
5- tags :
6- - ' * '
5+ tags :
6+ - " * "
77 workflow_dispatch :
8-
8+
99permissions :
1010 contents : write
11-
11+
1212jobs :
1313 release :
1414 strategy :
@@ -18,115 +18,117 @@ jobs:
1818 runs-on : ${{ matrix.os }}
1919
2020 steps :
21- - uses : actions/checkout@v4
22-
23- - name : Get version
24- id : get_version
25- run : echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
26-
27- - name : Restore cargo cache
28- uses : Swatinem/rust-cache@v2
29- env :
30- cache-name : ci
31- with :
32- shared-key : ${{ matrix.os }}-${{ env.cache-name }}-stable
33-
34- - name : Install Rust
35- uses : dtolnay/rust-toolchain@stable
36- with :
37- components : clippy
38-
39- - name : Build
40- if : matrix.os != 'ubuntu-22.04'
41- env :
42- GITUI_RELEASE : 1
43- run : cargo build
44- - name : Run tests
45- if : matrix.os != 'ubuntu-22.04'
46- run : make test
47- - name : Run clippy
48- if : matrix.os != 'ubuntu-22.04'
49- run : |
50- cargo clean
51- make clippy
52-
53- - name : Setup MUSL
54- if : matrix.os == 'ubuntu-latest'
55- run : |
56- rustup target add x86_64-unknown-linux-musl
57- sudo apt-get -qq install musl-tools
58-
59- - name : Setup ARM toolchain
60- if : matrix.os == 'ubuntu-22.04'
61- run : |
62- rustup target add aarch64-unknown-linux-gnu
63- rustup target add armv7-unknown-linux-gnueabihf
64- rustup target add arm-unknown-linux-gnueabihf
65-
66- curl -o $GITHUB_WORKSPACE/aarch64.tar.xz https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-a/8.2-2018.08/gcc-arm-8.2-2018.08-x86_64-aarch64-linux-gnu.tar.xz
67- curl -o $GITHUB_WORKSPACE/arm.tar.xz https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-a/8.2-2018.08/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf.tar.xz
68-
69- tar xf $GITHUB_WORKSPACE/aarch64.tar.xz
70- tar xf $GITHUB_WORKSPACE/arm.tar.xz
71-
72- echo "$GITHUB_WORKSPACE/gcc-arm-8.2-2018.08-x86_64-aarch64-linux-gnu/bin" >> $GITHUB_PATH
73- echo "$GITHUB_WORKSPACE/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf/bin" >> $GITHUB_PATH
74-
75- - name : Build Release Mac
76- if : matrix.os == 'macos-latest'
77- env :
78- GITUI_RELEASE : 1
79- run : make release-mac
80- - name : Build Release Mac x86
81- if : matrix.os == 'macos-latest'
82- env :
83- GITUI_RELEASE : 1
84- run : |
85- rustup target add x86_64-apple-darwin
86- make release-mac-x86
87- - name : Build Release Linux
88- if : matrix.os == 'ubuntu-latest'
89- env :
90- GITUI_RELEASE : 1
91- run : make release-linux-musl
92- - name : Build Release Win
93- if : matrix.os == 'windows-latest'
94- env :
95- GITUI_RELEASE : 1
96- run : make release-win
97- - name : Build Release Linux ARM
98- if : matrix.os == 'ubuntu-22.04'
99- env :
100- GITUI_RELEASE : 1
101- run : make release-linux-arm
102-
103- - name : Set SHA
104- if : matrix.os == 'macos-latest'
105- id : shasum
106- run : |
107- echo sha="$(shasum -a 256 ./release/gitui-mac.tar.gz | awk '{printf $1}')" >> $GITHUB_OUTPUT
108-
109- - name : Extract release notes
110- if : matrix.os == 'ubuntu-latest'
111- id : release_notes
112- uses : ffurrer2/extract-release-notes@v2
113-
114- - name : Release
115- uses : softprops/action-gh-release@v2
116- with :
117- body : ${{ steps.release_notes.outputs.release_notes }}
118- prerelease : ${{ contains(github.ref, '-') }}
119- files : |
120- ./release/*.tar.gz
121- ./release/*.zip
122- ./release/*.msi
123-
124- - name : Bump homebrew-core formula
125- uses : mislav/bump-homebrew-formula-action@v3
126- if : " matrix.os == 'macos-latest' && !contains(github.ref, '-')" # skip prereleases
127- env :
128- COMMITTER_TOKEN : ${{ secrets.BREW_TOKEN }}
129- with :
130- formula-name : gitui
131- # https://github.com/mislav/bump-homebrew-formula-action/issues/58
132- formula-path : Formula/g/gitui.rb
21+ - uses : actions/checkout@v4
22+
23+ - name : Get version
24+ id : get_version
25+ run : echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
26+
27+ - name : Restore cargo cache
28+ uses : Swatinem/rust-cache@v2
29+ env :
30+ cache-name : ci
31+ with :
32+ shared-key : ${{ matrix.os }}-${{ env.cache-name }}-stable
33+
34+ - name : Install Rust
35+ uses : dtolnay/rust-toolchain@stable
36+ with :
37+ components : clippy
38+
39+ - uses : taiki-e/install-action@nextest
40+
41+ - name : Build
42+ if : matrix.os != 'ubuntu-22.04'
43+ env :
44+ GITUI_RELEASE : 1
45+ run : cargo build
46+ - name : Run tests
47+ if : matrix.os != 'ubuntu-22.04'
48+ run : make test
49+ - name : Run clippy
50+ if : matrix.os != 'ubuntu-22.04'
51+ run : |
52+ cargo clean
53+ make clippy
54+
55+ - name : Setup MUSL
56+ if : matrix.os == 'ubuntu-latest'
57+ run : |
58+ rustup target add x86_64-unknown-linux-musl
59+ sudo apt-get -qq install musl-tools
60+
61+ - name : Setup ARM toolchain
62+ if : matrix.os == 'ubuntu-22.04'
63+ run : |
64+ rustup target add aarch64-unknown-linux-gnu
65+ rustup target add armv7-unknown-linux-gnueabihf
66+ rustup target add arm-unknown-linux-gnueabihf
67+
68+ curl -o $GITHUB_WORKSPACE/aarch64.tar.xz https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-a/8.2-2018.08/gcc-arm-8.2-2018.08-x86_64-aarch64-linux-gnu.tar.xz
69+ curl -o $GITHUB_WORKSPACE/arm.tar.xz https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-a/8.2-2018.08/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf.tar.xz
70+
71+ tar xf $GITHUB_WORKSPACE/aarch64.tar.xz
72+ tar xf $GITHUB_WORKSPACE/arm.tar.xz
73+
74+ echo "$GITHUB_WORKSPACE/gcc-arm-8.2-2018.08-x86_64-aarch64-linux-gnu/bin" >> $GITHUB_PATH
75+ echo "$GITHUB_WORKSPACE/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf/bin" >> $GITHUB_PATH
76+
77+ - name : Build Release Mac
78+ if : matrix.os == 'macos-latest'
79+ env :
80+ GITUI_RELEASE : 1
81+ run : make release-mac
82+ - name : Build Release Mac x86
83+ if : matrix.os == 'macos-latest'
84+ env :
85+ GITUI_RELEASE : 1
86+ run : |
87+ rustup target add x86_64-apple-darwin
88+ make release-mac-x86
89+ - name : Build Release Linux
90+ if : matrix.os == 'ubuntu-latest'
91+ env :
92+ GITUI_RELEASE : 1
93+ run : make release-linux-musl
94+ - name : Build Release Win
95+ if : matrix.os == 'windows-latest'
96+ env :
97+ GITUI_RELEASE : 1
98+ run : make release-win
99+ - name : Build Release Linux ARM
100+ if : matrix.os == 'ubuntu-22.04'
101+ env :
102+ GITUI_RELEASE : 1
103+ run : make release-linux-arm
104+
105+ - name : Set SHA
106+ if : matrix.os == 'macos-latest'
107+ id : shasum
108+ run : |
109+ echo sha="$(shasum -a 256 ./release/gitui-mac.tar.gz | awk '{printf $1}')" >> $GITHUB_OUTPUT
110+
111+ - name : Extract release notes
112+ if : matrix.os == 'ubuntu-latest'
113+ id : release_notes
114+ uses : ffurrer2/extract-release-notes@v2
115+
116+ - name : Release
117+ uses : softprops/action-gh-release@v2
118+ with :
119+ body : ${{ steps.release_notes.outputs.release_notes }}
120+ prerelease : ${{ contains(github.ref, '-') }}
121+ files : |
122+ ./release/*.tar.gz
123+ ./release/*.zip
124+ ./release/*.msi
125+
126+ - name : Bump homebrew-core formula
127+ uses : mislav/bump-homebrew-formula-action@v3
128+ if : " matrix.os == 'macos-latest' && !contains(github.ref, '-')" # skip prereleases
129+ env :
130+ COMMITTER_TOKEN : ${{ secrets.BREW_TOKEN }}
131+ with :
132+ formula-name : gitui
133+ # https://github.com/mislav/bump-homebrew-formula-action/issues/58
134+ formula-path : Formula/g/gitui.rb
0 commit comments