Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mufeedvh authored Mar 16, 2024
1 parent 3d39663 commit 8607f63
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Release Build

env:
PROJECT_NAME: code2prompt
Expand All @@ -10,8 +10,8 @@ on:
types: [published]

jobs:
release:
name: Release
build:
name: Build
runs-on: ${{ matrix.job.os }}
strategy:
fail-fast: false
Expand All @@ -25,6 +25,7 @@ jobs:
- { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , use-cross: use-cross }
- { os: ubuntu-latest , target: x86_64-unknown-linux-musl , use-cross: use-cross }
- { os: macos-latest , target: x86_64-apple-darwin }
- { os: macos-latest , target: aarch64-apple-darwin }
- { os: windows-latest , target: i686-pc-windows-gnu }
- { os: windows-latest , target: i686-pc-windows-msvc }
- { os: windows-latest , target: x86_64-pc-windows-gnu }
Expand All @@ -38,19 +39,26 @@ jobs:
target: ${{ matrix.job.target }}
override: true
default: true
- name: Install cross-compilation dependencies
if: matrix.job.target == 'arm-unknown-linux-gnueabihf' || matrix.job.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu
- name: Build release binary
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.job.use-cross }}
command: build
args: --release --target ${{ matrix.job.target }}
args: --release --target ${{ matrix.job.target }} --verbose
- name: Strip release binary (unix)
if: matrix.job.target != 'x86_64-pc-windows-msvc'
run: strip "target/${{ matrix.job.target }}/release/code2prompt"
- name: Upload release archive
uses: softprops/action-gh-release@v1
with:
files: |
target/${{ matrix.job.target }}/release/code2prompt${{ matrix.job.target == 'x86_64-pc-windows-msvc' && '.exe' || '' }}
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: target/${{ matrix.job.target }}/release/code2prompt${{ matrix.job.target == 'x86_64-pc-windows-msvc' && '.exe' || '' }}
asset_name: code2prompt-${{ matrix.job.target }}${{ matrix.job.target == 'x86_64-pc-windows-msvc' && '.exe' || '' }}
asset_content_type: application/octet-stream

0 comments on commit 8607f63

Please sign in to comment.