Skip to content

Commit 8607f63

Browse files
authored
Update build.yml
1 parent 3d39663 commit 8607f63

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release
1+
name: Release Build
22

33
env:
44
PROJECT_NAME: code2prompt
@@ -10,8 +10,8 @@ on:
1010
types: [published]
1111

1212
jobs:
13-
release:
14-
name: Release
13+
build:
14+
name: Build
1515
runs-on: ${{ matrix.job.os }}
1616
strategy:
1717
fail-fast: false
@@ -25,6 +25,7 @@ jobs:
2525
- { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , use-cross: use-cross }
2626
- { os: ubuntu-latest , target: x86_64-unknown-linux-musl , use-cross: use-cross }
2727
- { os: macos-latest , target: x86_64-apple-darwin }
28+
- { os: macos-latest , target: aarch64-apple-darwin }
2829
- { os: windows-latest , target: i686-pc-windows-gnu }
2930
- { os: windows-latest , target: i686-pc-windows-msvc }
3031
- { os: windows-latest , target: x86_64-pc-windows-gnu }
@@ -38,19 +39,26 @@ jobs:
3839
target: ${{ matrix.job.target }}
3940
override: true
4041
default: true
42+
- name: Install cross-compilation dependencies
43+
if: matrix.job.target == 'arm-unknown-linux-gnueabihf' || matrix.job.target == 'aarch64-unknown-linux-gnu'
44+
run: |
45+
sudo apt-get update
46+
sudo apt-get install -y gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu
4147
- name: Build release binary
4248
uses: actions-rs/cargo@v1
4349
with:
4450
use-cross: ${{ matrix.job.use-cross }}
4551
command: build
46-
args: --release --target ${{ matrix.job.target }}
52+
args: --release --target ${{ matrix.job.target }} --verbose
4753
- name: Strip release binary (unix)
4854
if: matrix.job.target != 'x86_64-pc-windows-msvc'
4955
run: strip "target/${{ matrix.job.target }}/release/code2prompt"
50-
- name: Upload release archive
51-
uses: softprops/action-gh-release@v1
52-
with:
53-
files: |
54-
target/${{ matrix.job.target }}/release/code2prompt${{ matrix.job.target == 'x86_64-pc-windows-msvc' && '.exe' || '' }}
56+
- name: Upload release asset
57+
uses: actions/upload-release-asset@v1
5558
env:
56-
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
59+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
60+
with:
61+
upload_url: ${{ github.event.release.upload_url }}
62+
asset_path: target/${{ matrix.job.target }}/release/code2prompt${{ matrix.job.target == 'x86_64-pc-windows-msvc' && '.exe' || '' }}
63+
asset_name: code2prompt-${{ matrix.job.target }}${{ matrix.job.target == 'x86_64-pc-windows-msvc' && '.exe' || '' }}
64+
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)