|
| 1 | +name: Continuous Deployment |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - '[0-9]+.[0-9]+.[0-9]+' |
| 7 | + |
| 8 | +jobs: |
| 9 | + publish: |
| 10 | + name: Publishing for ${{ matrix.job.os }} |
| 11 | + runs-on: ${{ matrix.job.os }} |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + job: |
| 15 | + - { os: macos-latest, target: x86_64-apple-darwin, use-cross: false } |
| 16 | + - { os: windows-latest, target: x86_64-pc-windows-msvc, use-cross: false } |
| 17 | + - { os: ubuntu-latest , target: x86_64-unknown-linux-gnu, use-cross: false } |
| 18 | + - { os: ubuntu-latest, target: x86_64-unknown-linux-musl, use-cross: true } |
| 19 | + - { os: ubuntu-latest, target: i686-unknown-linux-gnu, use-cross: true } |
| 20 | + - { os: ubuntu-latest, target: arm-unknown-linux-gnueabihf, use-cross: true } |
| 21 | + - { os: ubuntu-latest, target: aarch64-unknown-linux-gnu, use-cross: true } |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: Installing Rust toolchain |
| 25 | + uses: actions-rs/toolchain@v1 |
| 26 | + with: |
| 27 | + toolchain: stable |
| 28 | + profile: minimal |
| 29 | + override: true |
| 30 | + - name: Checkout repository |
| 31 | + uses: actions/checkout@v2 |
| 32 | + - name: Cargo build |
| 33 | + uses: actions-rs/cargo@v1 |
| 34 | + with: |
| 35 | + command: build |
| 36 | + use-cross: ${{ matrix.job.use-cross }} |
| 37 | + args: --release --target ${{ matrix.job.target }} |
| 38 | + |
| 39 | + - name: Install required dependencies |
| 40 | + shell: bash |
| 41 | + run: | |
| 42 | + if [[ ${{ matrix.job.target }} == arm-unknown-linux-gnueabihf ]]; then |
| 43 | + sudo apt update |
| 44 | + sudo apt-get install -y binutils-arm-linux-gnueabihf |
| 45 | + fi |
| 46 | + if [[ ${{ matrix.job.target }} == aarch64-unknown-linux-gnu ]]; then |
| 47 | + sudo apt update |
| 48 | + sudo apt-get install -y binutils-aarch64-linux-gnu |
| 49 | + fi |
| 50 | +
|
| 51 | + - name: Packaging final binary |
| 52 | + shell: bash |
| 53 | + env: |
| 54 | + TARGET: ${{ matrix.job.target }} |
| 55 | + PROJECT_NAME: delta |
| 56 | + PACKAGE_NAME: git-delta |
| 57 | + OS_NAME: ${{ matrix.job.os }} |
| 58 | + run: ./etc/ci/before_deploy.sh |
| 59 | + |
| 60 | + - name: Releasing assets |
| 61 | + uses: softprops/action-gh-release@v1 |
| 62 | + with: |
| 63 | + files: | |
| 64 | + delta-*-${{ matrix.job.target }}.* |
| 65 | + git-delta*.deb |
| 66 | + env: |
| 67 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments