downloads-khinsider-com-dl

Download all songs at once from downloads.khinsider.com
git clone https://git.ea.contact/downloads-khinsider-com-dl
Log | Files | Refs | README

build.yml (3014B)


      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 downloads-khinsider-com-dl-cli
     56 
     57       - name: Upload CLI artifact
     58         uses: actions/upload-artifact@v4
     59         with:
     60           name: downloads-khinsider-com-dl-cli
     61           path: target/release/downloads-khinsider-com-dl-cli.exe
     62 
     63   release:
     64     needs: build
     65     runs-on: ubuntu-latest
     66     permissions:
     67       contents: write
     68 
     69     steps:
     70       - uses: actions/checkout@v4
     71         with:
     72           fetch-depth: 0
     73 
     74       - name: Download CLI artifact
     75         uses: actions/download-artifact@v4
     76         with:
     77           name: downloads-khinsider-com-dl-cli
     78           path: artifacts/
     79 
     80       - name: Generate changelog
     81         id: changelog
     82         run: |
     83           PREV_TAG=$(git tag --sort=-version:refname | head -n 1)
     84           if [ -z "$PREV_TAG" ]; then
     85             CHANGELOG=$(git log --pretty=format:"- %s (%h)" | head -20)
     86           else
     87             CHANGELOG=$(git log "$PREV_TAG"..HEAD --pretty=format:"- %s (%h)")
     88           fi
     89           echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
     90           echo "$CHANGELOG" >> $GITHUB_OUTPUT
     91           echo "EOF" >> $GITHUB_OUTPUT
     92 
     93       - name: Create release tag
     94         id: tag
     95         run: |
     96           TAG="release-$(date +'%Y%m%d%H%M%S')"
     97           git tag "$TAG"
     98           git push origin "$TAG"
     99           echo "TAG=$TAG" >> $GITHUB_OUTPUT
    100 
    101       - name: Create GitHub release
    102         uses: softprops/action-gh-release@v2
    103         with:
    104           tag_name: ${{ steps.tag.outputs.TAG }}
    105           name: Release ${{ steps.tag.outputs.TAG }}
    106           body: |
    107             ## Changes
    108             ${{ steps.changelog.outputs.CHANGELOG }}
    109           files: |
    110             artifacts/downloads-khinsider-com-dl-cli.exe