Skip to content

Commit

Permalink
fixed build & added windows arm support
Browse files Browse the repository at this point in the history
  • Loading branch information
ciiqr committed Oct 26, 2024
1 parent a79ddc2 commit 8b180e5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
10 changes: 9 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
[target.'cfg(all(windows, target_env = "msvc"))']
[target.'cfg(target_env = "msvc")']
rustflags = ["-C", "target-feature=+crt-static"]

[target.'cfg(target_env = "musl")']
rustflags = [
"-C",
"target-feature=+crt-static",
"-L",
"-Wl,--copy-dt-needed-entries",
]
24 changes: 13 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,16 @@ jobs:
os: ubuntu-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: aarch64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.build.os }}
steps:
- uses: actions/checkout@v4
- name: Install target
run: rustup target add ${{ matrix.build.target }}
- name: Setup musl
run: |
rustup target add x86_64-unknown-linux-musl
sudo apt-get install -y musl-tools
echo 'LDFLAGS=-Wl,--copy-dt-needed-entries' >> $GITHUB_ENV
echo 'RUSTFLAGS=-C target-feature=+crt-static' >> $GITHUB_ENV
if: matrix.build.target == 'x86_64-unknown-linux-musl'
- name: Setup Apple Silicon
run: rustup target add aarch64-apple-darwin
if: matrix.build.target == 'aarch64-apple-darwin'
run: sudo apt-get install -y musl-tools
if: endsWith(matrix.build.target, '-musl')
- uses: Swatinem/rust-cache@v2
- name: Build
env:
Expand All @@ -45,12 +42,17 @@ jobs:
--message-format=json \
| jq -r '.message.rendered // .executable // empty'
)"
echo "ARTIFACT_PATH=$output" >> $GITHUB_ENV
{
echo 'ARTIFACT_PATHS<<EOF'
echo "$output"
echo 'EOF'
} >> "$GITHUB_ENV"
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.build.target }}
path: ${{ env.ARTIFACT_PATH }}
path: ${{ env.ARTIFACT_PATHS }}
if-no-files-found: error
release:
name: Release
needs: build
Expand Down
6 changes: 6 additions & 0 deletions files/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ when:
- family == "windows"
- arch == "x86_64"
executable: assets/x86_64-pc-windows-msvc/files.exe

---
when:
- family == "windows"
- arch == "aarch64"
executable: assets/aarch64-pc-windows-msvc/files.exe

0 comments on commit 8b180e5

Please sign in to comment.