Skip to content

Commit

Permalink
feat(ci): support windows builds (attempt building on the windows run…
Browse files Browse the repository at this point in the history
…ner)
  • Loading branch information
usagi-flow committed Aug 29, 2024
1 parent 64e81f7 commit aae4346
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/evil-build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ permissions: write-all

env:
RUST_BACKTRACE: 1
RUST_BUILD_PROFILE: release
HELIX_LOG_LEVEL: info
HELIX_DEFAULT_RUNTIME: /opt/helix/runtime
BINSTALL_DISABLE_TELEMETRY: true
Expand Down Expand Up @@ -59,30 +60,28 @@ jobs:
- name: Build
run: |
rustup target add ${{ matrix.target.id }}
cargo build --target ${{ matrix.target.id }} --profile release
cargo build --target ${{ matrix.target.id }} --profile $BUILD_PROFILE
if: ${{ matrix.target.native}}

- name: Build (cross)
run: cross build --target ${{ matrix.target.id }} --profile release
run: cross build --target ${{ matrix.target.id }} --profile $BUILD_PROFILE
if: ${{ !matrix.target.native}}

- name: "Prepare dist"
shell: bash
run: |
mkdir -pv dist/helix
if [ -f target/${{ matrix.target.id }}/release/hx ]; then
mv -v target/${{ matrix.target.id }}/release/hx dist/helix/
if [ -f target/${{ matrix.target.id }}/$BUILD_PROFILE/hx ]; then
mv -v target/${{ matrix.target.id }}/$BUILD_PROFILE/hx dist/helix/
else
mv -v target/${{ matrix.target.id }}/release/hx.exe dist/helix/
mv -v target/${{ matrix.target.id }}/$BUILD_PROFILE/hx.exe dist/helix/
fi
rm -rf runtime/grammars/sources
mv -v runtime dist/helix/
cd dist
if [[ "$RUNNER_OS" != "Windows" ]]; then
tar -cvzf "evil-helix-${{ matrix.target.name }}.tar.gz" helix
#else
# tar -a -c -f "evil-helix-${{ matrix.target.name }}.zip" helix
fi
- name: "Upload artifacts (tar)"
Expand All @@ -96,4 +95,3 @@ jobs:
with:
name: "evil-helix-${{ matrix.target.name }}"
path: "dist/helix"
#path: "dist/evil-helix-${{ matrix.target.name }}.*"
30 changes: 21 additions & 9 deletions .github/workflows/evil-build-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ permissions: write-all

env:
RUST_BACKTRACE: 1
RUST_BUILD_PROFILE: opt
HELIX_LOG_LEVEL: info
HELIX_DEFAULT_RUNTIME: /opt/helix/runtime
BINSTALL_DISABLE_TELEMETRY: true
Expand Down Expand Up @@ -80,30 +81,41 @@ jobs:
- name: Build
run: |
rustup target add ${{ matrix.target.id }}
cargo build --target ${{ matrix.target.id }} --profile opt
cargo build --target ${{ matrix.target.id }} --profile $BUILD_PROFILE
if: ${{ matrix.target.native}}

- name: Build (cross)
run: cross build --target ${{ matrix.target.id }} --profile opt
run: cross build --target ${{ matrix.target.id }} --profile $BUILD_PROFILE
if: ${{ !matrix.target.native}}

- name: "Prepare dist"
shell: bash
run: |
mkdir -pv dist/helix
if [ -f target/${{ matrix.target.id }}/opt/hx ]; then
mv -v target/${{ matrix.target.id }}/opt/hx dist/helix/
if [ -f target/${{ matrix.target.id }}/$BUILD_PROFILE/hx ]; then
mv -v target/${{ matrix.target.id }}/$BUILD_PROFILE/hx dist/helix/
else
mv -v target/${{ matrix.target.id }}/opt/hx.exe dist/helix/
mv -v target/${{ matrix.target.id }}/$BUILD_PROFILE/hx.exe dist/helix/
fi
rm -rf runtime/grammars/sources
mv -v runtime dist/helix/
cd dist && tar -cvzf helix-${{ matrix.target.name }}.tar.gz helix
cd dist
- name: "Upload artifacts"
if [[ "$RUNNER_OS" != "Windows" ]]; then
tar -cvzf "evil-helix-${{ matrix.target.name }}.tar.gz" helix
fi
- name: "Upload artifacts (tar)"
uses: actions/upload-artifact@v4
with:
name: "evil-helix-${{ matrix.target.name }}"
path: "dist/evil-helix-${{ matrix.target.name }}.tar.gz"

- name: "Upload artifacts (zip)"
uses: actions/upload-artifact@v4
with:
name: helix-${{ matrix.target.name }}
path: dist/helix-${{ matrix.target.name }}.tar.gz
name: "evil-helix-${{ matrix.target.name }}"
path: "dist/helix"

- name: Release suffix
id: release-suffix
Expand Down

0 comments on commit aae4346

Please sign in to comment.