xl-cli-tools

CLI tools for viewing and editing Excel files
Log | Files | Refs | README | LICENSE

release.yml (1851B)


      1 name: Release
      2 
      3 on:
      4   push:
      5     tags: ["v*"]
      6 
      7 permissions:
      8   contents: write
      9 
     10 jobs:
     11   build:
     12     strategy:
     13       matrix:
     14         include:
     15           - target: aarch64-apple-darwin
     16             os: macos-latest
     17             suffix: aarch64-apple-darwin
     18           - target: x86_64-unknown-linux-gnu
     19             os: ubuntu-latest
     20             suffix: x86_64-linux
     21     runs-on: ${{ matrix.os }}
     22     steps:
     23       - uses: actions/checkout@v4
     24 
     25       - uses: dtolnay/rust-toolchain@stable
     26         with:
     27           targets: ${{ matrix.target }}
     28 
     29       - name: Build release
     30         run: cargo build --release --target ${{ matrix.target }}
     31 
     32       - name: Package binaries
     33         run: |
     34           mkdir -p dist
     35           for bin in xlcat xlset xlfilter xldiff; do
     36             cp target/${{ matrix.target }}/release/$bin dist/${bin}-${{ matrix.suffix }}
     37           done
     38 
     39       - uses: actions/upload-artifact@v4
     40         with:
     41           name: binaries-${{ matrix.suffix }}
     42           path: dist/
     43 
     44   release:
     45     needs: build
     46     runs-on: ubuntu-latest
     47     steps:
     48       - uses: actions/checkout@v4
     49 
     50       - uses: actions/download-artifact@v4
     51         with:
     52           path: artifacts/
     53 
     54       - name: Prepare release assets
     55         run: |
     56           mkdir -p release
     57 
     58           for arch in aarch64-apple-darwin x86_64-linux; do
     59             for bin in xlcat xlset xlfilter xldiff; do
     60               cp artifacts/binaries-${arch}/${bin}-${arch} release/
     61             done
     62           done
     63 
     64           # Demo GIFs
     65           cp demo/*.gif release/
     66 
     67           # Make binaries executable
     68           chmod +x release/xl*-*
     69 
     70       - name: Create GitHub Release
     71         env:
     72           GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
     73         run: |
     74           gh release create ${{ github.ref_name }} \
     75             --title "${{ github.ref_name }}" \
     76             --generate-notes \
     77             release/*