arhivach-downloader

Download arhivach.vc threads
git clone https://git.ea.contact/arhivach-downloader
Log | Files | Refs | README

build.yml (3487B)


      1 name: Build Windows Executables
      2 
      3 on:
      4   push:
      5 
      6 jobs:
      7   check:
      8     runs-on: windows-latest
      9 
     10     steps:
     11       - uses: actions/checkout@v4
     12 
     13       - name: Install Rust
     14         uses: dtolnay/rust-toolchain@stable
     15         with:
     16           targets: x86_64-pc-windows-msvc
     17 
     18       - name: Cache cargo registry
     19         uses: actions/cache@v4
     20         with:
     21           path: |
     22             ~/.cargo/registry
     23             ~/.cargo/git
     24             target
     25           key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
     26           restore-keys: ${{ runner.os }}-cargo-
     27 
     28       - name: Cargo check
     29         run: cargo check --all-targets
     30 
     31   build:
     32     needs: check
     33     if: github.ref == 'refs/heads/master'
     34     runs-on: windows-latest
     35 
     36     steps:
     37       - uses: actions/checkout@v4
     38 
     39       - name: Install Rust
     40         uses: dtolnay/rust-toolchain@stable
     41         with:
     42           targets: x86_64-pc-windows-msvc
     43 
     44       - name: Cache cargo registry
     45         uses: actions/cache@v4
     46         with:
     47           path: |
     48             ~/.cargo/registry
     49             ~/.cargo/git
     50             target
     51           key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
     52           restore-keys: ${{ runner.os }}-cargo-
     53 
     54       - name: Build CLI
     55         run: cargo build --release --bin arhivach-downloader-cli
     56 
     57       - name: Build TUI
     58         run: cargo build --release --bin arhivach-downloader-tui
     59 
     60       - name: Upload CLI artifact
     61         uses: actions/upload-artifact@v4
     62         with:
     63           name: arhivach-downloader-cli
     64           path: target/release/arhivach-downloader-cli.exe
     65 
     66       - name: Upload TUI artifact
     67         uses: actions/upload-artifact@v4
     68         with:
     69           name: arhivach-downloader-tui
     70           path: target/release/arhivach-downloader-tui.exe
     71 
     72   release:
     73     needs: build
     74     runs-on: ubuntu-latest
     75     permissions:
     76       contents: write
     77 
     78     steps:
     79       - uses: actions/checkout@v4
     80         with:
     81           fetch-depth: 0
     82 
     83       - name: Download CLI artifact
     84         uses: actions/download-artifact@v4
     85         with:
     86           name: arhivach-downloader-cli
     87           path: artifacts/
     88 
     89       - name: Download TUI artifact
     90         uses: actions/download-artifact@v4
     91         with:
     92           name: arhivach-downloader-tui
     93           path: artifacts/
     94 
     95       - name: Generate changelog
     96         id: changelog
     97         run: |
     98           PREV_TAG=$(git tag --sort=-version:refname | head -n 1)
     99           if [ -z "$PREV_TAG" ]; then
    100             CHANGELOG=$(git log --pretty=format:"- %s (%h)" | head -20)
    101           else
    102             CHANGELOG=$(git log "$PREV_TAG"..HEAD --pretty=format:"- %s (%h)")
    103           fi
    104           echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
    105           echo "$CHANGELOG" >> $GITHUB_OUTPUT
    106           echo "EOF" >> $GITHUB_OUTPUT
    107 
    108       - name: Create release tag
    109         id: tag
    110         run: |
    111           TAG="release-$(date +'%Y%m%d%H%M%S')"
    112           git tag "$TAG"
    113           git push origin "$TAG"
    114           echo "TAG=$TAG" >> $GITHUB_OUTPUT
    115 
    116       - name: Create GitHub release
    117         uses: softprops/action-gh-release@v2
    118         with:
    119           tag_name: ${{ steps.tag.outputs.TAG }}
    120           name: Release ${{ steps.tag.outputs.TAG }}
    121           body: |
    122             ## Changes
    123             ${{ steps.changelog.outputs.CHANGELOG }}
    124           files: |
    125             artifacts/arhivach-downloader-cli.exe
    126             artifacts/arhivach-downloader-tui.exe