Skip to content

Commit

Permalink
ci: upload binaries to release
Browse files Browse the repository at this point in the history
fix: fix workflow
  • Loading branch information
imlk0 authored and oxr463 committed Aug 20, 2021
1 parent 3b5a975 commit ceda0a2
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 35 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Publish

on: [push, pull_request]

env:
CARGO_TERM_COLOR: always

jobs:
cross-compile:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
target:
- x86_64-unknown-linux-musl
- x86_64-unknown-linux-gnu
- x86_64-linux-android
- i686-unknown-linux-musl
- i686-unknown-linux-gnu
- i686-linux-android
- armv7-unknown-linux-musleabihf
- armv7-unknown-linux-gnueabihf
- arm-linux-androideabi
- aarch64-unknown-linux-musl
- aarch64-unknown-linux-gnu
- aarch64-linux-android
steps:
- uses: actions/checkout@v2
- uses: davidB/[email protected]
- name: Install cross
shell: bash
run: |
curl -L https://github.com/rust-embedded/cross/releases/download/v0.2.1/cross-v0.2.1-x86_64-unknown-linux-musl.tar.gz | tar -xzf - --to-stdout > ~/.cargo/bin/cross
chmod +x ~/.cargo/bin/cross
- name: Build proot-rs
shell: bash
run: |
USE_CROSS=true CARGO_BUILD_TARGET="${{ matrix.target }}" cargo make build --profile=production
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: proot-rs-${{ matrix.target }}
path: target/${{ matrix.target }}/release/proot-rs
- name: Compress binaries
# We only publish binaries when we create a tag
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
shell: bash
run: |
tar czvf proot-rs.tar.gz -C target/${{ matrix.target }}/release proot-rs
- name: Upload binaries to release
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: proot-rs.tar.gz
asset_name: proot-rs-$tag-${{ matrix.target }}.tar.gz
tag: ${{ github.ref }}
35 changes: 0 additions & 35 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,38 +84,3 @@ jobs:
shell: bash
run: |
PROOT_TEST_ROOTFS="$(pwd)/rootfs" bats -r tests
cross-compile:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-unknown-linux-musl
- x86_64-unknown-linux-gnu
- x86_64-linux-android
- i686-unknown-linux-musl
- i686-unknown-linux-gnu
- i686-linux-android
- armv7-unknown-linux-musleabihf
- armv7-unknown-linux-gnueabihf
- arm-linux-androideabi
- aarch64-unknown-linux-musl
- aarch64-unknown-linux-gnu
- aarch64-linux-android
steps:
- uses: actions/checkout@v2
- uses: davidB/[email protected]
- name: Install cross
shell: bash
run: |
curl -L https://github.com/rust-embedded/cross/releases/download/v0.2.1/cross-v0.2.1-x86_64-unknown-linux-musl.tar.gz | tar -xzf - --to-stdout > ~/.cargo/bin/cross
chmod +x ~/.cargo/bin/cross
- name: Build proot-rs
shell: bash
run: |
USE_CROSS=true CARGO_BUILD_TARGET="${{ matrix.target }}" cargo make build
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: proot-rs-${{ matrix.target }}
path: target/${{ matrix.target }}/debug/proot-rs

0 comments on commit ceda0a2

Please sign in to comment.