|
10 | 10 | - cron: '30 1 * * 0'
|
11 | 11 |
|
12 | 12 | jobs:
|
| 13 | + release: |
| 14 | + name: Release |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - name: Checkout Repository |
| 18 | + uses: actions/checkout@v4 |
| 19 | + - name: Install Rust |
| 20 | + uses: dtolnay/rust-toolchain@master |
| 21 | + with: |
| 22 | + toolchain: stable |
| 23 | + targets: i686-unknown-linux-musl,x86_64-unknown-linux-musl,aarch64-unknown-linux-musl |
| 24 | + components: clippy, rustfmt |
| 25 | + - name: Build |
| 26 | + run: | |
| 27 | + cargo --locked build --profile release |
| 28 | + - name: Install Test Dependencies |
| 29 | + run: | |
| 30 | + sudo apt-get update |
| 31 | + sudo apt-get install quilt gnupg2 libio-pty-perl |
| 32 | + - name: Test |
| 33 | + env: |
| 34 | + STG_PROVE_OPTS: "--jobs=2" |
| 35 | + STG_TEST_OPTS: "--verbose-log" |
| 36 | + STG_PROFILE: "release" |
| 37 | + run: | |
| 38 | + timeout 900s make -C t prove |
| 39 | + - name: Show Failures |
| 40 | + if: ${{ failure() }} |
| 41 | + run: | |
| 42 | + make -C t show-failure-results |
| 43 | + - name: Install Doc Dependencies |
| 44 | + run: | |
| 45 | + sudo apt-get install asciidoc asciidoctor docbook-xsl-ns xmlto |
| 46 | + - name: Build Docs Asciidoc |
| 47 | + run: | |
| 48 | + make -j2 doc |
| 49 | + - name: Build Docs Asciidoctor |
| 50 | + env: |
| 51 | + USE_ASCIIDOCTOR: "1" |
| 52 | + run: | |
| 53 | + make -j2 doc |
| 54 | + - name: Install HTML Docs |
| 55 | + env: |
| 56 | + USE_ASCIIDOCTOR: "1" |
| 57 | + run: | |
| 58 | + make -j2 htmldir="$GITHUB_WORKSPACE"/stgit-html install-html |
| 59 | + - name: Upload HTML Docs |
| 60 | + uses: actions/upload-artifact@v4 |
| 61 | + with: |
| 62 | + name: html-doc |
| 63 | + path: ${{ github.workspace }}/stgit-html |
| 64 | + - name: Install cargo-deb |
| 65 | + uses: baptiste0928/cargo-install@v3 |
| 66 | + with: |
| 67 | + crate: cargo-deb |
| 68 | + - name: Install cargo-generate-rpm |
| 69 | + uses: baptiste0928/cargo-install@v3 |
| 70 | + with: |
| 71 | + crate: cargo-generate-rpm |
| 72 | + version: "^0.14.0" |
| 73 | + - name: Install aarch64 Dependencies |
| 74 | + run: | |
| 75 | + sudo apt-get install gcc-aarch64-linux-gnu |
| 76 | + - name: Static Build x86_64 |
| 77 | + run: | |
| 78 | + make build-static-x86_64 |
| 79 | + - name: Static Build i686 |
| 80 | + run: | |
| 81 | + make build-static-i686 |
| 82 | + - name: Build Build aarch64 |
| 83 | + env: |
| 84 | + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: "aarch64-linux-gnu-gcc" |
| 85 | + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_STRIP: "aarch64-linux-gnu-strip" |
| 86 | + run: | |
| 87 | + make build-static-aarch64 |
| 88 | + - name: Build Packages |
| 89 | + env: |
| 90 | + USE_ASCIIDOCTOR: "1" |
| 91 | + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: "aarch64-linux-gnu-gcc" |
| 92 | + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_STRIP: "aarch64-linux-gnu-strip" |
| 93 | + run: | |
| 94 | + make packages |
| 95 | + - name: Upload Packages |
| 96 | + uses: actions/upload-artifact@v4 |
| 97 | + with: |
| 98 | + name: stgit-packages |
| 99 | + path: target/pkg/* |
| 100 | + |
| 101 | + build-and-test: |
| 102 | + name: Build and Test |
| 103 | + strategy: |
| 104 | + fail-fast: false |
| 105 | + matrix: |
| 106 | + include: |
| 107 | + - os: ubuntu-latest |
| 108 | + profile: dev |
| 109 | + toolchain: stable |
| 110 | + - os: ubuntu-latest |
| 111 | + profile: dev |
| 112 | + toolchain: nightly |
| 113 | + - os: macos-latest |
| 114 | + profile: dev |
| 115 | + toolchain: stable |
| 116 | + runs-on: ${{ matrix.os }} |
| 117 | + steps: |
| 118 | + - name: Checkout Repository |
| 119 | + uses: actions/checkout@v4 |
| 120 | + - name: Install Rust |
| 121 | + uses: dtolnay/rust-toolchain@master |
| 122 | + with: |
| 123 | + toolchain: ${{ matrix.toolchain }} |
| 124 | + - name: Build |
| 125 | + run: | |
| 126 | + cargo --locked build --profile ${{ matrix.profile }} |
| 127 | + - name: Install Test Dependencies |
| 128 | + if: ${{ matrix.os == 'ubuntu-latest' }} |
| 129 | + run: | |
| 130 | + sudo apt-get update |
| 131 | + sudo apt-get install quilt gnupg2 libio-pty-perl |
| 132 | + - name: Install Test Dependencies |
| 133 | + if: ${{ matrix.os == 'macos-latest' }} |
| 134 | + run: | |
| 135 | + # coreutils provides the `timeout` command used to wrap `make` below. |
| 136 | + # gnu-sed is needed by some tests (e.g. t3400-pick.sh). |
| 137 | + brew install coreutils cpanminus gnu-sed |
| 138 | + echo "$(brew --prefix)/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH |
| 139 | + echo "$(brew --prefix)/opt/coreutils/libexec/gnubin" >> $GITHUB_PATH |
| 140 | + sudo cpanm IO::Pty |
| 141 | + - name: Test |
| 142 | + env: |
| 143 | + STG_PROVE_OPTS: "--jobs=2" |
| 144 | + STG_TEST_OPTS: "--verbose-log" |
| 145 | + STG_PROFILE: ${{ matrix.profile }} |
| 146 | + run: | |
| 147 | + timeout 900s make -C t prove |
| 148 | + - name: Show Failures |
| 149 | + if: ${{ failure() }} |
| 150 | + run: | |
| 151 | + make -C t show-failure-results |
| 152 | +
|
| 153 | + unit-tests: |
| 154 | + name: Unit Tests |
| 155 | + runs-on: ubuntu-latest |
| 156 | + steps: |
| 157 | + - name: Checkout Repository |
| 158 | + uses: actions/checkout@v4 |
| 159 | + - name: Install Rust |
| 160 | + uses: dtolnay/rust-toolchain@master |
| 161 | + with: |
| 162 | + toolchain: stable |
| 163 | + - name: Run Unit Tests |
| 164 | + run: | |
| 165 | + cargo --locked test |
| 166 | +
|
| 167 | + clippy: |
| 168 | + name: Clippy Lint |
| 169 | + runs-on: ubuntu-latest |
| 170 | + steps: |
| 171 | + - name: Checkout repository |
| 172 | + uses: actions/checkout@v4 |
| 173 | + - name: Install Rust |
| 174 | + uses: dtolnay/rust-toolchain@master |
| 175 | + with: |
| 176 | + toolchain: stable |
| 177 | + components: clippy |
| 178 | + - name: Clippy Checks |
| 179 | + run: | |
| 180 | + cargo --locked clippy -- --deny warnings |
| 181 | +
|
| 182 | + rustfmt: |
| 183 | + name: Format Lint |
| 184 | + runs-on: ubuntu-latest |
| 185 | + steps: |
| 186 | + - name: Checkout repository |
| 187 | + uses: actions/checkout@v4 |
| 188 | + - name: Install Rust |
| 189 | + uses: dtolnay/rust-toolchain@master |
| 190 | + with: |
| 191 | + toolchain: stable |
| 192 | + components: rustfmt |
| 193 | + - name: Check formatting |
| 194 | + run: | |
| 195 | + cargo --locked fmt --all --check |
| 196 | +
|
| 197 | + api-docs: |
| 198 | + name: API Documentation |
| 199 | + runs-on: ubuntu-latest |
| 200 | + steps: |
| 201 | + - name: Checkout Repository |
| 202 | + uses: actions/checkout@v4 |
| 203 | + - name: Install Rust |
| 204 | + uses: dtolnay/rust-toolchain@master |
| 205 | + with: |
| 206 | + toolchain: stable |
| 207 | + - name: Build docs |
| 208 | + run: | |
| 209 | + cargo rustdoc -- --deny warnings |
| 210 | +
|
13 | 211 | windows-build:
|
14 | 212 | name: Windows Build
|
15 | 213 | runs-on: windows-latest
|
|
28 | 226 | with:
|
29 | 227 | msystem: UCRT64
|
30 | 228 | update: true
|
31 |
| - install: diffutils make https://repo.msys2.org/msys/x86_64/msys2-runtime-3.4.9-3-x86_64.pkg.tar.zst |
| 229 | + install: diffutils make |
32 | 230 | path-type: inherit
|
33 | 231 | - name: Test
|
34 | 232 | shell: msys2 {0}
|
@@ -58,3 +256,37 @@ jobs:
|
58 | 256 | with:
|
59 | 257 | name: stgit-msi-package
|
60 | 258 | path: contrib/wix/stgit-*.msi
|
| 259 | + |
| 260 | + github-release: |
| 261 | + name: GitHub Release |
| 262 | + if: ${{ startsWith(github.ref, 'refs/tags/') }} |
| 263 | + runs-on: ubuntu-latest |
| 264 | + needs: [release, windows-build] |
| 265 | + steps: |
| 266 | + - name: Checkout Repository |
| 267 | + uses: actions/checkout@v4 |
| 268 | + with: |
| 269 | + fetch-depth: 0 |
| 270 | + - name: Fetch Tag |
| 271 | + run: | |
| 272 | + git fetch --force origin "+${GITHUB_REF}:${GITHUB_REF}" |
| 273 | + - uses: actions/download-artifact@v4 |
| 274 | + with: |
| 275 | + path: artifacts |
| 276 | + - name: Make source archive |
| 277 | + run: | |
| 278 | + ./contrib/release/make-archive.sh artifacts |
| 279 | + - name: Latest Changes |
| 280 | + run: | |
| 281 | + ./contrib/release/latest-changelog.awk CHANGELOG.md >latest-changes.md |
| 282 | + - name: Draft Release |
| 283 | + uses: softprops/action-gh-release@v1 |
| 284 | + with: |
| 285 | + draft: true |
| 286 | + body_path: latest-changes.md |
| 287 | + fail_on_unmatched_files: true |
| 288 | + files: | |
| 289 | + artifacts/stgit-*.tar.gz |
| 290 | + artifacts/stgit-packages/*.deb |
| 291 | + artifacts/stgit-packages/*.rpm |
| 292 | + artifacts/stgit-msi-package/*.msi |
0 commit comments