release.yml (2485B)
1 name: Release 2 3 permissions: 4 contents: write 5 6 on: 7 push: 8 tags: 9 - v* 10 11 env: 12 CARGO_TERM_COLOR: always 13 14 jobs: 15 Test: 16 uses: ./.github/workflows/testing.yml 17 18 build: 19 needs: [Test] 20 runs-on: ${{ matrix.runner }} 21 env: 22 PROJECT_NAME: image-light-freq-conv 23 strategy: 24 fail-fast: false 25 matrix: 26 include: 27 - target: x86_64-unknown-linux-gnu 28 extension: "" 29 runner: ubuntu-latest 30 cross: true 31 - target: x86_64-pc-windows-msvc 32 extension: ".exe" 33 runner: windows-latest 34 cross: false 35 - target: aarch64-unknown-linux-gnu 36 extension: "" 37 runner: ubuntu-latest 38 cross: true 39 - target: aarch64-pc-windows-msvc 40 extension: ".exe" 41 runner: windows-latest 42 cross: false 43 - target: armv7-unknown-linux-gnueabihf 44 extension: "" 45 runner: ubuntu-latest 46 cross: true 47 48 steps: 49 - name: Checkout 50 uses: actions/checkout@main 51 52 - name: Install Dependencies on Windows 53 if: ${{ matrix.runner == 'windows-latest' }} 54 run: | 55 choco install make --yes 56 - name: Install Dependencies on MacOS 57 if: ${{ matrix.runner == 'macos-latest' }} 58 run: | 59 brew install make 60 61 - name: Install cross (if needed) 62 if: ${{ matrix.cross }} 63 run: cargo install cross --git https://github.com/cross-rs/cross 64 65 - name: Build Project on cross 66 if: ${{ matrix.cross }} 67 run: | 68 cross build --release --target ${{ matrix.target }} --verbose 69 - name: Build Project 70 if: ${{ !matrix.cross }} 71 run: | 72 rustup target add ${{ matrix.target }} 73 cargo build --release --target ${{ matrix.target }} --verbose 74 75 - name: Rename Artifacts 76 shell: bash 77 run: | 78 mv target/${{ matrix.target }}/release/${{ env.PROJECT_NAME }}{,-${{ github.ref_name }}-${{ matrix.target }}${{ matrix.extension }}} 79 80 - name: Release Artifacts 81 uses: softprops/action-gh-release@master 82 env: 83 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 84 with: 85 files: | 86 target/${{ matrix.target }}/release/${{ env.PROJECT_NAME }}-${{ github.ref_name }}-${{ matrix.target }}${{ matrix.extension }}