-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect non-default build targets for cross compilation #87
Comments
The toolchain file should help in this scenario right? It could be created with https://github.com/marketplace/actions/create-file. |
Hmmm I'm not sure that does the job. I just tried adding a |
From what I see we'd also have to use a cargo configuration file. https://doc.rust-lang.org/cargo/reference/config.html#configuration-format We can also specify the target directory here to resolve the issue of resolving the build artifacts. |
I ran into this issue as well. A dirty workaround for me was to use cargo to build the project, then run That way I could also use the rust-cache action so my builds are pretty snappy now. This method is obviously not ideal, but at least gets the job done for now. Full github action workflow name: vercel-dev
on:
push:
branches-ignore:
- main
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
# rust:
# uses: ./.github/workflows/rust.yml
deploy:
runs-on: ubuntu-latest
# needs: rust
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Rust setup
uses: actions-rs/toolchain@v1
with:
target: x86_64-unknown-linux-musl
profile: minimal
toolchain: stable
override: true
- run: rustup default stable-x86_64-unknown-linux-musl
- name: Rust cache
uses: Swatinem/rust-cache@v2
- name: Rust build
uses: actions-rs/cargo@v1
with:
command: build
args: --quiet --release
- run: rm -rf target/release && mv target/x86_64-unknown-linux-musl/release target/release/
- name: Vercel build
run: npm install --global vercel@canary
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
with:
vercel-args: "--prebuilt"
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-org-id: ${{ vars.VERCEL_ORG_ID}}
vercel-project-id: ${{ vars.VERCEL_PROJECT_ID}} |
When compiling in GitHub Actions it's necessary to target
x86_64-unknown-linux-musl
, which currently can only be set using theCARGO_BUILD_TARGET
environment variable - and even then, the runtime doesn't know to look intarget/x86_64-unknown-linux-musl/...
for build artifacts.Detection of
CARGO_BUILD_TARGET
would probably be enough, idk if the runtime can be configured with CLI args or viavercel.json
.The text was updated successfully, but these errors were encountered: